alma::acs::commandcenter::util::PreparedString Class Reference

Collaboration diagram for alma::acs::commandcenter::util::PreparedString:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 PreparedString (String p)
 PreparedString (String p, char placeholder)
String toString (String[] pieces)
String toString ()

Package Attributes

String[] pattern

Detailed Description

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.


Constructor & Destructor Documentation

alma::acs::commandcenter::util::PreparedString::PreparedString ( String  p  )  [inline]

Constructs an instance with the given source string and "?" as the placeholder character for later insertions.

Parameters:
p pattern like "my name is ?"
alma::acs::commandcenter::util::PreparedString::PreparedString ( String  p,
char  placeholder 
) [inline]

Constructs an instance with the given source string and the given placeholder character.

Parameters:
p pattern like "my name is ?" (if the placeholder is "?")

References pattern.


Member Function Documentation

String alma::acs::commandcenter::util::PreparedString::toString (  )  [inline]
String alma::acs::commandcenter::util::PreparedString::toString ( String[]  pieces  )  [inline]

Returns a version of the original source string where the placeholders have been replaced with the given string elements.

References pattern.

Referenced by alma::acs::commandcenter::engine::ToolManager::generateCommand(), alma::acs::commandcenter::engine::Executor::remoteNative(), and alma::acs::commandcenter::engine::ExecuteServices::startLocalJava().


Member Data Documentation

Referenced by PreparedString(), and toString().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2