public class OptionalMatcher extends CustomDefaultLabelMatcher<OptionalMatcher>
Matcher that tries its submatcher once against the input and always succeeds.| Modifier and Type | Field and Description |
|---|---|
Matcher |
subMatcher |
| Constructor and Description |
|---|
OptionalMatcher(Rule subRule) |
| Modifier and Type | Method and Description |
|---|---|
<R> R |
accept(MatcherVisitor<R> visitor)
Accepts the given matcher visitor.
|
boolean |
match(MatcherContext context)
Tries a match on the given MatcherContext.
|
defaultLabel, getLabel, hasCustomLabelareMismatchesMemoed, areSubnodesSuppressed, getSubContext, getTag, isNodeSkipped, isNodeSuppressed, label, memoMismatches, setTag, skipNode, suppressNode, suppressSubnodes, toStringgetChildrenclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetChildrenpublic final Matcher subMatcher
public OptionalMatcher(Rule subRule)
public boolean match(MatcherContext context)
Matchercontext - the MatcherContextpublic <R> R accept(MatcherVisitor<R> visitor)
Matchervisitor - the visitor