public class StringSubstitution extends Object implements Substitution
Util.substitute.| 构造器和说明 |
|---|
StringSubstitution()
Default constructor initializing substitution to a zero length
String.
|
StringSubstitution(String substitution)
Creates a StringSubstitution representing the given string.
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
String |
getSubstitution()
Returns the string substitution represented by this object.
|
void |
setSubstitution(String substitution)
Sets the substitution represented by this StringSubstitution.
|
String |
toString()
Returns the same value as
getSubstitution(). |
public StringSubstitution()
public StringSubstitution(String substitution)
substitution - The string to use as a substitution.public void setSubstitution(String substitution)
substitution - The string to use as a substitution.public String getSubstitution()
public String toString()
getSubstitution().
public void appendSubstitution(StringBuffer appendBuffer, MatchResult match, int substitutionCount, PatternMatcherInput originalInput, PatternMatcher matcher, Pattern pattern)
Substitution.appendSubstition()
for more details regarding the expected behavior of this method.
appendSubstitution 在接口中 SubstitutionappendBuffer - 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.Copyright © 2022. All rights reserved.