Class TokenReplacer
java.lang.Object
org.apache.torque.generator.control.TokenReplacer
- All Implemented Interfaces:
StringProcessor
Replaces placeholder tokens like ${option:optionName} in a string by the
resolved values. The escape character is the backslash (\).
$Id: TokenReplacer.java 1917241 2024-04-21 13:29:41Z tv $
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charThe escape character.static final StringThe prefix for an option token.static final charThe separator between prefix and key.static final charThe character ending a token.static final charFirst character of a Token start.static final charSecond character of a Token start. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
TOKEN_START_1
public static final char TOKEN_START_1First character of a Token start.- See Also:
-
TOKEN_START_2
public static final char TOKEN_START_2Second character of a Token start.- See Also:
-
TOKEN_END
public static final char TOKEN_ENDThe character ending a token.- See Also:
-
ESCAPE
public static final char ESCAPEThe escape character.- See Also:
-
OPTION_PREFIX
The prefix for an option token.- See Also:
-
PREFIX_SEPARATOR
public static final char PREFIX_SEPARATORThe separator between prefix and key.- See Also:
-
-
Constructor Details
-
TokenReplacer
- Parameters:
controllerState- to init the token replacer
-
-
Method Details
-
process
Resolves all Tokens ${option:optionName} and replaces them with the appropriate value.- Specified by:
processin interfaceStringProcessor- Parameters:
toProcess- the String to remove tokens from, or null.- Returns:
- the processed String.
-