T
- the type of the node to match onN
- the type of the subnode that the given matcher should matchpublic abstract class ChildMultiMatcher<T extends com.sun.source.tree.Tree,N extends com.sun.source.tree.Tree> extends Object implements MultiMatcher<T,N>
MultiMatcher
that applies a matcher across multiple children of a single ancestor node.
Configurable to return true if any of, all of, or the last node matches. In the any or last of
cases, provides access to the node that matched.Modifier and Type | Class and Description |
---|---|
static class |
ChildMultiMatcher.MatchType |
MultiMatcher.MultiMatchResult<N extends com.sun.source.tree.Tree>
Modifier and Type | Field and Description |
---|---|
protected Matcher<N> |
nodeMatcher
The matcher to apply to the subnodes in question.
|
Constructor and Description |
---|
ChildMultiMatcher(ChildMultiMatcher.MatchType matchType,
Matcher<N> nodeMatcher) |
Modifier and Type | Method and Description |
---|---|
protected abstract Iterable<? extends N> |
getChildNodes(T tree,
VisitorState state)
Returns the set of child nodes to match.
|
boolean |
matches(T tree,
VisitorState state) |
MultiMatcher.MultiMatchResult<N> |
multiMatchResult(T tree,
VisitorState state)
Attempt to match the given node, and return the associated subnodes that matched.
|
public ChildMultiMatcher(ChildMultiMatcher.MatchType matchType, Matcher<N> nodeMatcher)
public boolean matches(T tree, VisitorState state)
public MultiMatcher.MultiMatchResult<N> multiMatchResult(T tree, VisitorState state)
MultiMatcher
multiMatchResult
in interface MultiMatcher<T extends com.sun.source.tree.Tree,N extends com.sun.source.tree.Tree>
@ForOverride protected abstract Iterable<? extends N> getChildNodes(T tree, VisitorState state)
Copyright © 2021 Google LLC. All rights reserved.