Skip to main content

CharacterCaseTransformer

Changes the character case.

Notes

Modifies the character case of matching fields and values by caseType using one of the following:

  • UPPER
  • LOWER
  • WORDS
  • WORDSFULLY
  • SENTENCES
  • SENTENCESFULLY
  • STRING
  • STRINGFULLY
  • SWAP

The applyTo property specifies the target for the change, defaulting to VALUE:

  • VALUE
  • FIELD
  • BOTH

Parser Handler Compatibility

This functionality can be applied as either a pre-parse or post-parse handler.

Examples

The following example first convert a title to lower case except for the first character.

handler:
class: CharacterCaseTransformer
applyTo: FIELD
caseType: LOWER
fieldMatcher:
pattern: title

Usage

Full configuration skeleton, with every option and its default
class: CharacterCaseTransformer
applyTo: string
caseType: string
fieldMatcher:
ignoreCase: false
ignoreDiacritic: false
matchEmpty: false
method: BASIC
negateMatches: false
partial: false
pattern: string
replaceAll: false
trim: false
label: string

Properties

PropertyTypeRequiredDefault
applyTostringNo-
caseTypestringNo-
fieldMatcherTextMatcherNoTextMatcher
labelstringNo-

Property Details

applyTo

The default behavior can be adjusted as follows:

  • VALUE: Changes are applied only to the field values.
    • Example: Field Name: "Title", Field Value: "hello world" → Field Value becomes "HELLO WORLD"
  • FIELD: Changes are applied only to the field name.
    • Example: Field Name: "title", Field Value: "hello world" → Field Name becomes "TITLE"
  • BOTH: Changes are applied to both the field name and its values.
    • Example: Field Name: "title", Field Value: "hello world" → Field Name becomes "TITLE", Field Value becomes "HELLO WORLD"

caseType

Transforms the character case of matching fields and values using one of these methods:

  • UPPER: Converts all characters to upper case.
    • Example: "hello world""HELLO WORLD"
  • LOWER: Converts all characters to lower case.
    • Example: "HELLO WORLD""hello world"
  • WORDS: Capitalizes the first letter of each word, leaving other characters unchanged.
    • Example: "hello WORLD""Hello WORLD"
  • WORDSFULLY: Capitalizes the first letter of each word and converts all other characters to lower case.
    • Example: "hello WORLD""Hello World"
  • SENTENCES: Capitalizes the first letter of each sentence, leaving other characters unchanged.
    • Example: "hello world. HOW are you?""Hello world. HOW are you?"
  • SENTENCESFULLY: Capitalizes the first letter of each sentence and converts all other characters to lower case.
    • Example: "hello world. HOW are you?""Hello world. How are you?"
  • STRING: Capitalizes the first letter of the entire string, leaving other characters unchanged.
    • Example: "hello WORLD""Hello WORLD"
  • STRINGFULLY: Capitalizes the first letter of the entire string and converts all other characters to lower case.
    • Example: "hello WORLD""Hello world"
  • SWAP: Swaps the case of all characters, converting upper case to lower case and vice versa.
    • Example: "Hello World""hELLO wORLD"

fieldMatcher

Matches document fields based on specified patterns and methods

label

An optional, user-supplied label for this step in the importer pipeline. It has no effect on processing — it exists purely to help identify this step, for example in large configurations or in the visual configurator.