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.
  • Interface Summary
    Interface Description
    Matcher<T extends com.sun.source.tree.Tree>
    Define a predicate on a Tree, which also accesses the state of AST traversal.
    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.
    Suppressible  
  • Class Summary
    Class Description
    AbstractTypeMatcher<T extends com.sun.source.tree.Tree>
    Base class for type matchers.
    AnnotationDoesNotHaveArgument
    Matches an annotation that does not have a particular argument, possibly because the default value is being used.
    AnnotationHasArgumentWithValue  
    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.
    AnnotationMatcherUtils
    Utilities for matching annotations.
    AnnotationType  
    Asserts
    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>
    A MultiMatcher that applies a matcher across multiple children of a single ancestor node.
    CompileTimeConstantExpressionMatcher
    A matcher for compile-time-constant expressions.
    CompoundAssignment
    Matcher for a compound-assignment operator expression.
    ConstructorOfClass
    Applies the given matcher to the constructor(s) of the given class.
    Contains
    A matcher that recursively inspects a tree, applying the given matcher to all levels of each tree and returning true if any match is found.
    Description
    Simple data object containing the information captured about an AST match.
    Description.Builder
    Builder for Descriptions.
    Enclosing
    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>  
    FieldMatchers
    Static utility methods for creating Matchers for detecting references to fields.
    HasArguments
    Matches if the given matcher matches all of/any of the parameters to this method.
    HasIdentifier
    Matches if the given matcher matches all of the identifiers under this syntax tree.
    InjectMatchers
    Utility constants and matchers related to dependency injection.
    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>  
    JUnitMatchers
    Matchers for code patterns which appear to be JUnit-based tests.
    Matchers
    Static factory methods which make the DSL read more fluently.
    MethodHasParameters
    Matches if the given matcher matches all of/any of the parameters to this method.
    MethodInvocation
    Matches a method invocation based on a matcher for the method select (receiver + method identifier) and one for the arguments.
    MethodInvocationArgument
    Applies an Expression matcher to an argument of a MethodInvocation by position.
    MethodInvocationMethodSelect
    Adapts a matcher on MethodInvocationTree to match the MethodSelect of the MethodInvocation.
    MethodVisibility
    A matcher for method visibility (public, private, protected, or default).
    MultiMatcher.MultiMatchResult<N extends com.sun.source.tree.Tree>
    A result from the call of MultiMatcher.multiMatchResult(Tree, VisitorState), containing information about whether it matched, and if so, what nodes matched.
    NullnessMatcher
    Matches an expression based on the result of the nullness dataflow analysis.
    Returns
    Matches a return statement whose returned expression is matched by the given matcher.
    StringLiteral  
    TestNgMatchers
    Matchers for code patterns which appear to be TestNG-based tests.
    Throws
    Matches a throw statement whose thrown expression is matched by the given matcher.
    WaitMatchers
    Matchers for method invocations related to Object.wait() and Condition.await();
  • Enum Summary
    Enum Description
    ChildMultiMatcher.MatchType  
    MethodVisibility.Visibility
    The visibility of a member.