Class CharacterCaseTransformerConfig
java.lang.Object
com.norconex.importer.handler.BaseLabelableConfig
com.norconex.importer.handler.BaseDocHandlerConfig
com.norconex.importer.handler.transformer.impl.CharacterCaseTransformerConfig
- All Implemented Interfaces:
Labelable
Changes the character case of matching fields and values according to one of the following methods:
- upper: Changes all characters to upper case.
- lower: Changes all characters values to lower case.
- words: Converts the first letter of each words to upper case, and leaves the character case of other characters unchanged.
- wordsFully: Converts the first letter of each words to upper case, and the rest to lower case.
- sentences: Converts the first letter of each sentence to upper case, and leaves the character case of other characters unchanged.
- sentencesFully: Converts the first letter of each sentence to upper case, and converts other characters to lower case.
- string: Converts the first letter of a string to upper case, and leaves the character case of other characters unchanged.
- stringFully: Converts the first letter of a string to upper case, and converts other characters to lower case.
- swap: Converts all upper case characters to lower case, and all lower case to upper case.
The change of character case can be applied to one of the following (defaults to "value" when unspecified):
- value: Applies to the field values.
- field: Applies to the field name.
- both: Applies to both the field name and its values.
Field names are referenced in a case insensitive manner.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanWhether to apply the case transformation to fields, values, or both.The type of character case transformation.Optional matcher of fields to apply transformation to.inthashCode()setApplyTo(String applyTo) Whether to apply the case transformation to fields, values, or both.setCaseType(String caseType) The type of character case transformation.setFieldMatcher(TextMatcher fieldMatcher) Optional matcher of fields to apply transformation to.toString()Methods inherited from class com.norconex.importer.handler.BaseLabelableConfig
getLabel, setLabel
-
Field Details
-
CASE_WORDS
- See Also:
-
CASE_WORDS_FULLY
- See Also:
-
CASE_UPPER
- See Also:
-
CASE_LOWER
- See Also:
-
CASE_SWAP
- See Also:
-
CASE_SENTENCES
- See Also:
-
CASE_SENTENCES_FULLY
- See Also:
-
CASE_STRING
- See Also:
-
CASE_STRING_FULLY
- See Also:
-
APPLY_VALUE
- See Also:
-
APPLY_FIELD
- See Also:
-
APPLY_BOTH
- See Also:
-
-
Constructor Details
-
CharacterCaseTransformerConfig
public CharacterCaseTransformerConfig()
-
-
Method Details
-
getFieldMatcher
Optional matcher of fields to apply transformation to. When not specified, transformation is on the document content.- Returns:
- field matcher
-
setFieldMatcher
Optional matcher of fields to apply transformation to. When not specified, transformation is on the document content.- Parameters:
fieldMatcher- field matcher
-
getCaseType
The type of character case transformation.- Returns:
- type of case transformation
-
getApplyTo
Whether to apply the case transformation to fields, values, or both. Does not apply when using this transformer on document content.- Returns:
- one of "field", "value", or "both"
-
setCaseType
The type of character case transformation.- Parameters:
caseType- type of case transformation- Returns:
this.
-
setApplyTo
Whether to apply the case transformation to fields, values, or both. Does not apply when using this transformer on document content.- Parameters:
applyTo- one of "field", "value", or "both"- Returns:
this.
-
equals
- Overrides:
equalsin classBaseLabelableConfig
-
canEqual
- Overrides:
canEqualin classBaseLabelableConfig
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseLabelableConfig
-
toString
- Overrides:
toStringin classBaseLabelableConfig
-