public abstract class Rewriter
extends Object
Modifier and Type | Field and Description |
---|---|
protected StringBuffer |
buffer |
Constructor and Description |
---|
Rewriter(String regularExpression)
Constructs a rewriter using the given regular expression; the syntax
is the same as for 'Pattern.compile'.
|
Modifier and Type | Method and Description |
---|---|
int |
end()
Returns the offset after the last character matched.
|
String |
group(int i)
Returns the input subsequence captured by the given group during the
previous match operation.
|
abstract String |
replacement()
Overridden to compute a replacement for each match.
|
String |
rewrite(CharSequence original)
Returns the result of rewriting 'original' by invoking the method
'replacement' for each match of the regular expression supplied to the
constructor.
|
StringBuffer |
rewrite(CharSequence original,
StringBuffer destination)
Returns the result of appending the rewritten 'original' to
'destination'.
|
public Rewriter(String regularExpression)
public int end()
public String group(int i)
public abstract String replacement()
public String rewrite(CharSequence original)
public StringBuffer rewrite(CharSequence original, StringBuffer destination)
Copyright © 2010-2020 Toolsverse. All Rights Reserved.