Klasse ConstantNameCreator
java.lang.Object
org.apache.torque.generator.processor.string.CharReplacer
org.apache.torque.generator.processor.string.ConstantNameCreator
- Alle implementierten Schnittstellen:
StringProcessor
Creates the name of a constant from a string. All letters in the String are
capitalized, and underscores (_) are used as separators per default.
If the string is empty or starts with a number, an underscore(_) is prefixed to the constant name.
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final String
The String which is usually used as prefix in front of upper case characters in java constants.Von Klasse geerbte Felder org.apache.torque.generator.processor.string.CharReplacer
JAVA_CLASSNAME_REPLACEMENT, JAVA_CLASSNAME_SPECIAL_CHARS
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungReturns the prefix which is used as Separator when an upper case character is encountered after a lower case character.Replaces all characters intoProcess
which occur intoReplace
withtoReplaceWith
; groups of special characters are treated as one.void
setUpperCaseSeparationPrefix
(String upperCaseSeparationPrefix) Sets the prefix which is used as Separator when an upper case character is encountered after a lower case character.Von Klasse geerbte Methoden org.apache.torque.generator.processor.string.CharReplacer
getToReplace, getToReplaceWith, setToReplace, setToReplaceWith, toString
-
Felddetails
-
UPPER_CASE_SEPPARATION_PREFIX
The String which is usually used as prefix in front of upper case characters in java constants.- Siehe auch:
-
-
Konstruktordetails
-
ConstantNameCreator
public ConstantNameCreator()Constructor.
-
-
Methodendetails
-
getUpperCaseSeparationPrefix
Returns the prefix which is used as Separator when an upper case character is encountered after a lower case character.- Gibt zurück:
- the separator which is inserted between a lower case character and an upper case character.
-
setUpperCaseSeparationPrefix
Sets the prefix which is used as Separator when an upper case character is encountered after a lower case character.- Parameter:
upperCaseSeparationPrefix
- the separator which is inserted between a lower case character and an upper case character.
-
process
Replaces all characters intoProcess
which occur intoReplace
withtoReplaceWith
; groups of special characters are treated as one. InsertsUPPER_CASE_SEPPARATION_PREFIX
if an upper case character follows a lower case character, and converts all charcters to upper case. If the string starts is empty or start with a number, the charactertoReplaceWith
is prefixed to the constant name. Finally, the new String is returned.Example: "prOceSS-*+ing~#._Test" is converted to "PR_OCE_SS_ING_TEST"
- Angegeben von:
process
in SchnittstelleStringProcessor
- Setzt außer Kraft:
process
in KlasseCharReplacer
- Parameter:
toProcess
- the String in which replacement should occur, not null.- Gibt zurück:
- the processed String, not null.
-