From 16734d528a9a6d2d86f4c277333864a8ba13a1c8 Mon Sep 17 00:00:00 2001 From: Pascal Essiembre Date: Mon, 2 Sep 2024 01:40:06 -0400 Subject: [PATCH] Javadoc updates. --- .../checksum/BaseChecksummerConfig.java | 15 +---- .../checksum/impl/Md5DocumentChecksummer.java | 32 +-------- .../impl/Md5DocumentChecksummerConfig.java | 66 +------------------ 3 files changed, 6 insertions(+), 107 deletions(-) diff --git a/crawler/core/src/main/java/com/norconex/crawler/core/doc/operations/checksum/BaseChecksummerConfig.java b/crawler/core/src/main/java/com/norconex/crawler/core/doc/operations/checksum/BaseChecksummerConfig.java index 5c5d913a3..a2b22e1d5 100644 --- a/crawler/core/src/main/java/com/norconex/crawler/core/doc/operations/checksum/BaseChecksummerConfig.java +++ b/crawler/core/src/main/java/com/norconex/crawler/core/doc/operations/checksum/BaseChecksummerConfig.java @@ -33,12 +33,6 @@ * Implementors should offer this XML configuration usage: *

* - * {@nx.xml #usage - * - * keep="[false|true]" - * toField="(optional metadata field to store the checksum)" - * onSet="[append|prepend|replace|optional]" /> - * } *

* toField is ignored unless the keep * attribute is set to true. @@ -46,29 +40,22 @@ */ @Data @Accessors(chain = true) -@SuppressWarnings("javadoc") public class BaseChecksummerConfig { /** * Whether to keep the metadata checksum value as a new metadata field. - * @param keep true to keep the checksum - * @return true to keep the checksum */ private boolean keep; /** * The metadata field to use to store the checksum value. - * Default value is set by checksummer implementations. + * A default field name may be set by checksummer implementations. * Only applicable if {@link #isKeep()} returns {@code true} - * @param toField the metadata field name - * @return metadata field name */ private String toField; /** * The property setter to use when a value is set. - * @param onSet property setter - * @return property setter */ private PropertySetter onSet; } diff --git a/crawler/core/src/main/java/com/norconex/crawler/core/doc/operations/checksum/impl/Md5DocumentChecksummer.java b/crawler/core/src/main/java/com/norconex/crawler/core/doc/operations/checksum/impl/Md5DocumentChecksummer.java index 697c0711d..b65ce7114 100644 --- a/crawler/core/src/main/java/com/norconex/crawler/core/doc/operations/checksum/impl/Md5DocumentChecksummer.java +++ b/crawler/core/src/main/java/com/norconex/crawler/core/doc/operations/checksum/impl/Md5DocumentChecksummer.java @@ -38,10 +38,11 @@ *

*

* You have the option to keep the checksum as a document metadata field. - * When {@link #setKeep(boolean)} is true, the checksum will be + * When {@link Md5DocumentChecksummerConfig#setKeep(boolean)} is + * true, the checksum will be * stored in the target field name specified. If you do not specify any, * it stores it under the metadata field name - * {@link CrawlDocMetadata#CHECKSUM_METADATA}. + * {@value CrawlDocMetadata#CHECKSUM_METADATA}. *

* *

@@ -54,38 +55,11 @@ * will ignore the content while specifying none will only use the content. *

* - * {@nx.xml.usage - * - * - * - * (expression matching fields used to create the checksum) - * - * - * } *

* toField is ignored unless the keep * attribute is set to true. *

- * - * {@nx.xml.example - * - * } - * - *

- * The above example uses the document body (default) to make the checksum. - *

- * - *

- * Since 2.0.0, a self-closing - * <documentChecksummer/> tag without any attributes - * is used to disable checksum generation. - *

*/ -@SuppressWarnings("javadoc") @Data public class Md5DocumentChecksummer extends AbstractDocumentChecksummer { diff --git a/crawler/core/src/main/java/com/norconex/crawler/core/doc/operations/checksum/impl/Md5DocumentChecksummerConfig.java b/crawler/core/src/main/java/com/norconex/crawler/core/doc/operations/checksum/impl/Md5DocumentChecksummerConfig.java index 53389c45b..b7b226bf5 100644 --- a/crawler/core/src/main/java/com/norconex/crawler/core/doc/operations/checksum/impl/Md5DocumentChecksummerConfig.java +++ b/crawler/core/src/main/java/com/norconex/crawler/core/doc/operations/checksum/impl/Md5DocumentChecksummerConfig.java @@ -15,78 +15,20 @@ package com.norconex.crawler.core.doc.operations.checksum.impl; import com.norconex.commons.lang.text.TextMatcher; -import com.norconex.crawler.core.doc.CrawlDocMetadata; import com.norconex.crawler.core.doc.operations.checksum.BaseChecksummerConfig; -import com.norconex.crawler.core.doc.operations.checksum.DocumentChecksummer; import lombok.Data; import lombok.experimental.Accessors; /** - *

Implementation of {@link DocumentChecksummer} which - * returns a MD5 checksum value of the extracted document content unless - * one or more given source fields are specified, in which case the MD5 - * checksum value is constructed from those fields. This checksum is normally - * performed right after the document has been imported. - *

- *

- * You have the option to keep the checksum as a document metadata field. - * When {@link #setKeep(boolean)} is true, the checksum will be - * stored in the target field name specified. If you do not specify any, - * it stores it under the metadata field name - * {@link CrawlDocMetadata#CHECKSUM_METADATA}. - *

- * - *

- * Since 1.9.0, it is possible to use a combination of document content - * and fields to create the checksum by setting - * combineFieldsAndContent to true. - * If you combine fields and content but you don't define a field matcher, - * it will be the equivalent of adding all fields. - * If you do not combine the two, specifying a field matcher - * will ignore the content while specifying none will only use the content. - *

- * - * {@nx.xml.usage - * - * - * - * (expression matching fields used to create the checksum) - * - * - * } - *

- * toField is ignored unless the keep - * attribute is set to true. - *

- * - * {@nx.xml.example - * - * } - * - *

- * The above example uses the document body (default) to make the checksum. - *

- * - *

- * Since 2.0.0, a self-closing - * <documentChecksummer/> tag without any attributes - * is used to disable checksum generation. - *

+ * Configuration for {@link Md5DocumentChecksummer}. */ -@SuppressWarnings("javadoc") @Data @Accessors(chain = true) public class Md5DocumentChecksummerConfig extends BaseChecksummerConfig { /** - * The field matcher. - * @param fieldMatcher field matcher - * @return field matcher + * Matcher of one or more fields to use to make up the checksum. */ private final TextMatcher fieldMatcher = new TextMatcher(); @@ -98,10 +40,6 @@ public Md5DocumentChecksummerConfig setFieldMatcher( /** * Whether we are combining the fields and content checksums. - * @param combineFieldsAndContent true if combining fields - * and content checksums - * @return true if combining fields and content checksums */ private boolean combineFieldsAndContent; - }