Class AnnotationAttributeMatcher
java.lang.Object
tech.picnic.errorprone.bugpatterns.util.AnnotationAttributeMatcher
- All Implemented Interfaces:
Serializable
A matcher of (annotation, attribute) pairs.
This class allows one to define a whitelist or blacklist of annotations or their attributes. Annotations are identified by their fully qualified name.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotationAttributeMatcherCreates anAnnotationAttributeMatcher.Stream<? extends ExpressionTree>Returns the subset of arguments of the givenAnnotationTreematched by this instance.
-
Method Details
-
create
public static AnnotationAttributeMatcher create(Optional<? extends List<String>> inclusions, Iterable<String> exclusions) Creates anAnnotationAttributeMatcher.Each string provided to this method must be of the form
"some.fully.qualified.AnnotationType"or"some.fully.qualified.AnnotationType#attribute".- Parameters:
inclusions- If specified, only the listed annotations or annotation attributes are matched.exclusions- The listed annotations or annotation attributes are not matched.- Returns:
- A non-
nullAnnotationAttributeMatcher.
-
extractMatchingArguments
Returns the subset of arguments of the givenAnnotationTreematched by this instance.- Parameters:
tree- The annotation AST node to be inspected.- Returns:
- Any matching annotation arguments.
-