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.