Class WrapReservedJavaWords
java.lang.Object
org.apache.torque.generator.processor.string.WrapReservedJavaWords
- All Implemented Interfaces:
StringProcessor
Processes an input String as follows: If the input String is a reserved word
in java, a suffix and/or prefix is appended to the input String and the
result is returned; otherwise the input string is returned unchanged.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionChecks whether the input is a reserved java word.voidsetAppendWhenReserved(String suffix) Sets the suffix to be appended if the input is a reserved word.voidsetPrependWhenReserved(String prefix) Sets the prefix to be prepended if the input is a reserved word.
-
Constructor Details
-
WrapReservedJavaWords
public WrapReservedJavaWords()
-
-
Method Details
-
setPrependWhenReserved
Sets the prefix to be prepended if the input is a reserved word.- Parameters:
prefix- the new prefix, not null.- Throws:
NullPointerException- if prefix is null.
-
setAppendWhenReserved
Sets the suffix to be appended if the input is a reserved word.- Parameters:
suffix- the new suffix, not null.- Throws:
NullPointerException- if suffix is null.
-
process
Checks whether the input is a reserved java word. If yes, prefix and suffix are prepended and appended, and the result is returned. If no, the input is returned unchanged.- Specified by:
processin interfaceStringProcessor- Parameters:
toProcess- the input.- Returns:
- the output.
-