public class TokenStreamTransformationPattern extends java.lang.Object
$name
.
assertNotNull($a)
$a != null
assertNotNull(foo)
foo != null
$a1
to signal that the code matched to $a1
should only be exactly 1
token in length.Modifier and Type | Field and Description |
---|---|
static int |
NO_MATCH
Returned if the matcher did not match.
|
Constructor and Description |
---|
TokenStreamTransformationPattern(java.lang.String searchPatternString,
java.lang.String replacementPatternString,
ELanguage language)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static java.util.List<IToken> |
applyPatterns(java.util.List<IToken> tokens,
java.util.List<TokenStreamTransformationPattern> patterns)
Applies the given patterns on the token stream and replaces all matches with
the transformed tokens.
|
int |
containsMoreVariables(int offset,
java.util.List<IToken> tokens)
Checks if the given tokens after the given offset contain more variables that
should be replaced.
|
ELanguage |
getLanguage() |
public static final int NO_MATCH
public TokenStreamTransformationPattern(java.lang.String searchPatternString, java.lang.String replacementPatternString, ELanguage language) throws CheckException
CheckException
- if the search pattern has invalid syntax.public int containsMoreVariables(int offset, java.util.List<IToken> tokens)
public static java.util.List<IToken> applyPatterns(java.util.List<IToken> tokens, java.util.List<TokenStreamTransformationPattern> patterns)
public ELanguage getLanguage()