public final class SingleMatchContext extends java.lang.Object implements MatchContext
| Constructor and Description |
|---|
SingleMatchContext(boolean result)
Default constructor with a non-regexp match result.
|
SingleMatchContext(java.util.regex.Matcher matcher)
Default constructor with a matcher.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.regex.MatchResult |
getMatchResult()
Returns the match result to access group information.
|
boolean |
hasGroupMatch()
Checks if the match produced at least one group match.
|
boolean |
isMatched()
Checks if the match was successful.
|
java.lang.String |
translateName(java.lang.String input)
Translates the name if it contains placeholders with the matching groups.
|
public SingleMatchContext(boolean result)
result - the result of the match.public SingleMatchContext(java.util.regex.Matcher matcher)
matcher - the matcher to access group information.public boolean isMatched()
MatchContextisMatched in interface MatchContexttrue if the match was successful, false
otherwise.public java.util.regex.MatchResult getMatchResult()
MatchContextgetMatchResult in interface MatchContextpublic java.lang.String translateName(java.lang.String input)
translateName in interface MatchContextinput - the input name that may contain placeholders.input
does not contain any placeholders.public boolean hasGroupMatch()
hasGroupMatch in interface MatchContexttrue if at least one group is matched,
false otherwise.