Class DocumentLengthTransformerConfig
- All Implemented Interfaces:
Labelable
Adds the document length (i.e., number of bytes) to
the specified field. The length is the document
content length as it is in its current processing stage. If for
instance you set this tagger after a transformer that modifies the content,
the obtained length will be for the modified content, and not the
original length. To obtain a document's length before any modification
was made to it, use this tagger as one of the first
handler in your pre-parse handlers.
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 by supplying a
PropertySetter.
Can be used both as a pre-parse or post-parse handler.
The following stores the document lenght into a "docSize" field.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleangetOnSet()Gets the property setter to use when a value is set.Gets the target field.inthashCode()setOnSet(PropertySetter onSet) Gets the property setter to use when a value is set.setToField(String toField) Gets the target field.toString()Methods inherited from class com.norconex.importer.handler.BaseLabelableConfig
getLabel, setLabel
-
Constructor Details
-
DocumentLengthTransformerConfig
public DocumentLengthTransformerConfig()
-
-
Method Details
-
getToField
Gets the target field.- Returns:
- target field
-
getOnSet
Gets the property setter to use when a value is set.- Returns:
- property setter
-
setToField
Gets the target field.- Parameters:
toField- target field- Returns:
this.
-
setOnSet
Gets the property setter to use when a value is set.- Parameters:
onSet- property setter- Returns:
this.
-
equals
- Overrides:
equalsin classBaseLabelableConfig
-
canEqual
- Overrides:
canEqualin classBaseLabelableConfig
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseLabelableConfig
-
toString
- Overrides:
toStringin classBaseLabelableConfig
-