StringSubstitution()
Default constructor initializing substitution to a zero length
String.
StringSubstitution(java.lang.String substitution)
Creates a StringSubstitution representing the given string.
Method Summary
void
appendSubstitution(java.lang.StringBuffer appendBuffer,
MatchResult match,
int substitutionCount,
PatternMatcherInput originalInput,
PatternMatcher matcher,
Pattern pattern)
Appends the substitution to a buffer containing the original input
with substitutions applied for the pattern matches found so far.
java.lang.String
getSubstitution()
Returns the string substitution represented by this object.
void
setSubstitution(java.lang.String substitution)
Sets the substitution represented by this StringSubstitution.
Default constructor initializing substitution to a zero length
String.
StringSubstitution
public StringSubstitution(java.lang.String substitution)
Creates a StringSubstitution representing the given string.
Parameters:
substitution - The string to use as a substitution.
Method Detail
setSubstitution
public void setSubstitution(java.lang.String substitution)
Sets the substitution represented by this StringSubstitution. You
should use this method in order to avoid repeatedly allocating new
StringSubstitutions. It is recommended that you allocate a single
StringSubstitution and reuse it by using this method when appropriate.
Parameters:
substitution - The string to use as a substitution.
getSubstitution
public java.lang.String getSubstitution()
Returns the string substitution represented by this object.
Returns:
The string substitution represented by this object.
Appends the substitution to a buffer containing the original input
with substitutions applied for the pattern matches found so far.
See
Substitution.appendSubstition()
for more details regarding the expected behavior of this method.