Class CharacterCaseTransformer
java.lang.Object
com.norconex.importer.handler.transformer.impl.CharacterCaseTransformer
- All Implemented Interfaces:
Configurable<CharacterCaseTransformerConfig>,ConfigurableDocHandler<CharacterCaseTransformerConfig>,DocHandler
public class CharacterCaseTransformer
extends Object
implements ConfigurableDocHandler<CharacterCaseTransformerConfig>
Changes the character case of a document content or matching fields 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.
When dealing with fields, 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 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
-
CharacterCaseTransformer
public CharacterCaseTransformer()
-
-
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.- Throws:
IOException- An I/O exception of some sort has occurred
-
getConfiguration
- Specified by:
getConfigurationin interfaceConfigurable<CharacterCaseTransformerConfig>
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-