Class AnnotationMatcher<T extends com.sun.source.tree.Tree>
java.lang.Object
com.google.errorprone.matchers.ChildMultiMatcher<T,com.sun.source.tree.AnnotationTree>
com.google.errorprone.matchers.AnnotationMatcher<T>
- All Implemented Interfaces:
Matcher<T>
,MultiMatcher<T,
,com.sun.source.tree.AnnotationTree> Serializable
public class AnnotationMatcher<T extends com.sun.source.tree.Tree>
extends ChildMultiMatcher<T,com.sun.source.tree.AnnotationTree>
Matches if the given annotation matcher matches all of or any of the annotations on the tree
node.
- Author:
- eaftan@google.com (Eddie Aftandilian)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.errorprone.matchers.ChildMultiMatcher
ChildMultiMatcher.MatchType
Nested classes/interfaces inherited from interface com.google.errorprone.matchers.MultiMatcher
MultiMatcher.MultiMatchResult<N extends com.sun.source.tree.Tree>
-
Field Summary
Fields inherited from class com.google.errorprone.matchers.ChildMultiMatcher
nodeMatcher
-
Constructor Summary
ConstructorDescriptionAnnotationMatcher
(ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.AnnotationTree> nodeMatcher) -
Method Summary
Modifier and TypeMethodDescriptionprotected Iterable
<? extends com.sun.source.tree.AnnotationTree> getChildNodes
(T tree, VisitorState state) Returns the set of child nodes to match.Methods inherited from class com.google.errorprone.matchers.ChildMultiMatcher
matches, multiMatchResult
-
Constructor Details
-
AnnotationMatcher
public AnnotationMatcher(ChildMultiMatcher.MatchType matchType, Matcher<com.sun.source.tree.AnnotationTree> nodeMatcher)
-
-
Method Details
-
getChildNodes
protected Iterable<? extends com.sun.source.tree.AnnotationTree> getChildNodes(T tree, VisitorState state) Description copied from class:ChildMultiMatcher
Returns the set of child nodes to match. The nodes must be immediate children of the current node to ensure the TreePath calculation is correct. MultiMatchers with other requirements should not subclass ChildMultiMatcher.- Specified by:
getChildNodes
in classChildMultiMatcher<T extends com.sun.source.tree.Tree,
com.sun.source.tree.AnnotationTree>
-