Class SubstringTransformerConfig
java.lang.Object
com.norconex.importer.handler.BaseLabelableConfig
com.norconex.importer.handler.BaseDocHandlerConfig
com.norconex.importer.handler.transformer.impl.SubstringTransformerConfig
- All Implemented Interfaces:
Labelable
Keep a substring of the content matching a begin and end character indexes. Useful when you have to truncate long content, or when you know precisely where is located the text to extract in some files.
The "begin" value is inclusive, while the "end" value is exclusive. Both are optional. When not specified (or a negative value), the index is assumed to be the beginning and end of the content, respectively.
This class can be used as a pre-parsing (text content-types only) or post-parsing handlers.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanlonggetBegin()The beginning index (inclusive).longgetEnd()The end index (exclusive).Gets source field matcher for fields to transform.inthashCode()setBegin(long begin) The beginning index (inclusive).setEnd(long end) The end index (exclusive).setFieldMatcher(TextMatcher fieldMatcher) Sets source field matcher for fields to transform.setSourceCharset(Charset sourceCharset) toString()Methods inherited from class com.norconex.importer.handler.BaseLabelableConfig
getLabel, setLabel
-
Constructor Details
-
SubstringTransformerConfig
public SubstringTransformerConfig()
-
-
Method Details
-
getFieldMatcher
Gets source field matcher for fields to transform.- Returns:
- field matcher
-
setFieldMatcher
Sets source field matcher for fields to transform.- Parameters:
fieldMatcher- field matcher
-
getSourceCharset
-
getBegin
public long getBegin()The beginning index (inclusive). A negative value is treated the same as zero.- Returns:
- beginning index
-
getEnd
public long getEnd()The end index (exclusive). A negative value is treated as the content end.- Returns:
- the end index
-
setSourceCharset
- Returns:
this.
-
setBegin
The beginning index (inclusive). A negative value is treated the same as zero.- Parameters:
begin- beginning index- Returns:
this.
-
setEnd
The end index (exclusive). A negative value is treated as the content end.- Parameters:
end- end index- Returns:
this.
-
equals
- Overrides:
equalsin classBaseLabelableConfig
-
canEqual
- Overrides:
canEqualin classBaseLabelableConfig
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseLabelableConfig
-
toString
- Overrides:
toStringin classBaseLabelableConfig
-