Class ConstantTransformer
java.lang.Object
com.norconex.importer.handler.transformer.impl.ConstantTransformer
- All Implemented Interfaces:
Configurable<ConstantTransformerConfig>,ConfigurableDocHandler<ConstantTransformerConfig>,DocHandler
public class ConstantTransformer
extends Object
implements ConfigurableDocHandler<ConstantTransformerConfig>
Define and add constant values to documents. To add multiple constant values under the same constant name, repeat the constant entry with a different value.
Storing values in an existing field
If a target field with the same name already exists for a document,
values will be added to the end of the existing value list.
It is possible to change this default behavior
with ConstantTransformerConfig.setOnSet(PropertySetter).
Can be used both as a pre-parse or post-parse handler.
- See Also:
-
Field Summary
Fields inherited from interface com.norconex.commons.lang.config.Configurable
PROPERTYFields inherited from interface com.norconex.importer.handler.DocHandler
NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanbooleanhandle(DocHandlerContext docCtx) Perform any operations on a document.inthashCode()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.norconex.importer.handler.DocHandler
close, init
-
Constructor Details
-
ConstantTransformer
public ConstantTransformer()
-
-
Method Details
-
handle
Description copied from interface:DocHandlerPerform any operations on a document.- Specified by:
handlein interfaceDocHandler- Parameters:
docCtx- the document handling context- Returns:
falseto stop processing and reject a document ortrueto proceed to the next configured handler.
-
getConfiguration
- Specified by:
getConfigurationin interfaceConfigurable<ConstantTransformerConfig>
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-