Public Member Functions | |
PreparedString (String p) | |
PreparedString (String p, char placeholder) | |
String | toString (String[] pieces) |
String | toString () |
Package Attributes | |
String[] | pattern |
Purpose of this class is to resolve placeholders in a source string like "my name is ?".
Invocation of the toString(String[]) method will resolve the placeholders to the elements of the string array.
If the string array contains too few elements, placeholders characters will be left in the output string. If the string array contains too many elements, the superfluous elements will not be inserted in the output string.
Note: Relationship between alma.acs.commandcenter.util.PreparedString and alma.acs.commandcenter.util.VariableString:
alma.acs.commandcenter.util.PreparedString uses positional parameters to replace placeholders with the elements of a string array. alma.acs.commandcenter.util.VariableString uses named parameters to replace placeholders with real values from a map.
alma.acs.commandcenter.util.PreparedString.PreparedString | ( | String | p | ) |
Constructs an instance with the given source string and "?" as the placeholder character for later insertions.
p | pattern like "my name is ?" |
alma.acs.commandcenter.util.PreparedString.PreparedString | ( | String | p, | |
char | placeholder | |||
) |
Constructs an instance with the given source string and the given placeholder character.
p | pattern like "my name is ?" (if the placeholder is "?") |
References alma.acs.commandcenter.util.PreparedString.pattern.
String alma.acs.commandcenter.util.PreparedString.toString | ( | String[] | pieces | ) |
Returns a version of the original source string where the placeholders have been replaced with the given string elements.
References alma.acs.commandcenter.util.PreparedString.pattern.
Referenced by alma.acs.commandcenter.engine.ToolManager.generateCommand(), and alma.acs.commandcenter.engine.ExecuteServices.startLocalJava().
String alma.acs.commandcenter.util.PreparedString.toString | ( | ) |
String [] alma.acs.commandcenter.util.PreparedString.pattern [package] |