类 StringSubstitution
java.lang.Object
org.apache.oro.text.regex.StringSubstitution
- 所有已实现的接口:
Substitution
- 直接已知子类:
Perl5Substitution
StringSubstitution implements a Substitution consisting of a simple
literal string. This class is intended for use with
Util.substitute.-
构造器概要
构造器构造器说明Default constructor initializing substitution to a zero length String.StringSubstitution(String substitution) Creates a StringSubstitution representing the given string. -
方法概要
修饰符和类型方法说明voidappendSubstitution(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.Returns the string substitution represented by this object.voidsetSubstitution(String substitution) Sets the substitution represented by this StringSubstitution.toString()Returns the same value asgetSubstitution().
-
构造器详细资料
-
StringSubstitution
public StringSubstitution()Default constructor initializing substitution to a zero length String. -
StringSubstitution
Creates a StringSubstitution representing the given string.- 参数:
substitution- The string to use as a substitution.
-
-
方法详细资料
-
setSubstitution
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.
-
getSubstitution
Returns the string substitution represented by this object.- 返回:
- The string substitution represented by this object.
-
toString
Returns the same value asgetSubstitution(). -
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. SeeSubstitution.appendSubstition()for more details regarding the expected behavior of this method.- 指定者:
appendSubstitution在接口中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.
-