org.apache.oro.text.regex
Class StringSubstitution
java.lang.Object
org.apache.oro.text.regex.StringSubstitution
- Substitution
public class StringSubstitution
extends java.lang.Object
StringSubstitution implements a Substitution consisting of a simple
literal string. This class is intended for use with
Util.substitute
.
Version:
- 1.1
Substitution
, Util
, Util.substitute
, Substitution
, Perl5Substitution
StringSubstitution() - Default constructor initializing substitution to a zero length
String.
|
StringSubstitution(String substitution) - Creates a StringSubstitution representing the given string.
|
StringSubstitution
public StringSubstitution()
Default constructor initializing substitution to a zero length
String.
StringSubstitution
public StringSubstitution(String substitution)
Creates a StringSubstitution representing the given string.
substitution
- The string to use as a substitution.
appendSubstitution
public void appendSubstitution(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.
See
Substitution.appendSubstition()
for more details regarding the expected behavior of this method.
- appendSubstitution in interface Substitution
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. This is a read-only parameter and is not modified.matcher
- The PatternMatcher used to find the current match.pattern
- The Pattern used to find the current match.
getSubstitution
public String getSubstitution()
Returns the string substitution represented by this object.
- The string substitution represented by this object.
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.
substitution
- The string to use as a substitution.
toString
public String toString()
- The string substitution represented by this object.
Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.