Package com.google.errorprone.matchers
package com.google.errorprone.matchers
A predicate DSL for matching javac AST nodes. This allows concise, readable declarative code for
describing a match, by composing generic-type-safe matchers on the inspected AST subtree.
-
ClassDescriptionAbstractTypeMatcher<T extends com.sun.source.tree.Tree>Base class for type matchers.Matches an annotation that does not have a particular argument, possibly because the default value is being used.AnnotationMatcher<T extends com.sun.source.tree.Tree>Matches if the given annotation matcher matches all of or any of the annotations on the tree node.Utilities for matching annotations.Matches assert statements which have a condition expression matched by the given matcher.ChildMultiMatcher<T extends com.sun.source.tree.Tree,
N extends com.sun.source.tree.Tree> AMultiMatcher
that applies a matcher across multiple children of a single ancestor node.A matcher for compile-time-constant expressions.Matcher for a compound-assignment operator expression.Applies the given matcher to the constructor(s) of the given class.A matcher that recursively inspects a tree, applying the given matcher to all levels of each tree and returningtrue
if any match is found.Simple data object containing the information captured about an AST match.Builder forDescription
s.Adapt matchers to match against a parent node of a given type.Enclosing.Block<T extends com.sun.source.tree.Tree>Enclosing.BlockOrCase<T extends com.sun.source.tree.Tree>Enclosing.Class<T extends com.sun.source.tree.Tree>Enclosing.Method<T extends com.sun.source.tree.Tree>Static utility methods for creatingMatcher
s for detecting references to fields.Matches if the given matcher matches all of/any of the parameters to this method.Matches if the given matcher matches all of the identifiers under this syntax tree.Utility constants and matchers related to dependency injection.Matches expressions that can be statically determined to be non-null.IsSameType<T extends com.sun.source.tree.Tree>Matches an AST node if its erased type is the same as the given type, e.g.IsSubtypeOf<T extends com.sun.source.tree.Tree>Matchers for code patterns which appear to be JUnit-based tests.Matcher<T extends com.sun.source.tree.Tree>Define a predicate on aTree
, which also accesses the state of AST traversal.Static factory methods which make the DSL read more fluently.Matches if the given matcher matches all of/any of the parameters to this method.Matches a method invocation based on a matcher for the method select (receiver + method identifier) and one for the arguments.Applies an Expression matcher to an argument of a MethodInvocation by position.A matcher for method visibility (public, private, protected, or default).The visibility of a member.MultiMatcher<T extends com.sun.source.tree.Tree,N extends com.sun.source.tree.Tree> An matcher that applies a single matcher across multiple tree nodes.MultiMatcher.MultiMatchResult<N extends com.sun.source.tree.Tree>A result from the call ofMultiMatcher.multiMatchResult(Tree, VisitorState)
, containing information about whether it matched, and if so, what nodes matched.Matches an expression based on the result of the nullness dataflow analysis.Matches areturn
statement whose returned expression is matched by the given matcher.Matchers for code patterns which appear to be TestNG-based tests.Matches athrow
statement whose thrown expression is matched by the given matcher.Matches expressions that invoke or reference a non-void method or constructor and which do not use their return value and are not in a context where non-use of the return value is allowed.Enumeration of known reasons that an unused return value may be allowed because of the context in which the method is used.Matchers for method invocations related to Object.wait() and Condition.await();