All Packages Class Hierarchy This Package Previous Next Index
Class com.oroinc.text.regex.StringSubstitution
java.lang.Object
|
+----com.oroinc.text.regex.StringSubstitution
- public class StringSubstitution
- extends Object
- implements Substitution
StringSubstitution implements a Substitution consisting of a simple
literal string. This class is intended for use with
Util.substitute .
Copyright © 1997-1998 Original Reusable Objects, Inc.
All rights reserved.
- Author:
- Daniel F. Savarese
- See Also:
- Substitution, Util, substitute, Substitution, Perl5Substitution
-
StringSubstitution()
- Default constructor initializing substitution to a zero length
String.
-
StringSubstitution(String)
- Creates a StringSubstitution representing the given string.
-
appendSubstitution(StringBuffer, MatchResult, int, String, PatternMatcher, Pattern)
- Appends the substitution to a buffer containing the original input
with substitutions applied for the pattern matches found so far.
-
getSubstitution()
- Returns the string substitution represented by this object.
-
setSubstitution(String)
- Sets the substitution represented by this StringSubstitution.
-
toString()
- Returns the same value as
getSubstitution() .
StringSubstitution
public StringSubstitution()
- Default constructor initializing substitution to a zero length
String.
StringSubstitution
public StringSubstitution(String substitution)
- Creates a StringSubstitution representing the given string.
- Parameters:
- substitution - The string to use as a substitution.
setSubstitution
public void setSubstitution(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 String getSubstitution()
- Returns the string substitution represented by this object.
- Returns:
- The string substitution represented by this object.
toString
public String toString()
- Returns the same value as
getSubstitution() .
- Returns:
- The string substitution represented by this object.
- Overrides:
- toString in class Object
appendSubstitution
public void appendSubstitution(StringBuffer appendBuffer,
MatchResult match,
int substitutionCount,
String 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.
See
Substitution.appendSubstitution for more details regarding the
expected behavior of this method.
- Parameters:
- appendBuffer - The buffer containing the new string resulting
from performing substitutions on the original input.
- match - The current match causing a substitution to be made.
- substitutionCount - The number of substitutions that have been
performed so far by Util.substitute.
- originalInput - The original input upon which the substitutions are
being performed.
- matcher - The PatternMatcher used to find the current match.
- pattern - The Pattern used to find the current match.
All Packages Class Hierarchy This Package Previous Next Index