Class AnnotationMatcher
The annotation pattern, expressed as a method pattern, is used to find matching annotations. The format of the expression is as follows:
@#annotationClass#(#parameterName#=#parameterValue#, #parameterName#=#parameterValue#...)
EXAMPLES:@java.lang.SuppressWarnings - Matches java.lang.SuppressWarnings with no parameters. @myhttp.Get(serviceName="payments", path="recentPayments") - Matches references to myhttp.Get where the parameters are also matched. @myhttp.Get(path="recentPayments", serviceName="payments") - Exactly the same results from the previous example, order of parameters does not matter. @java.lang.SuppressWarnings("deprecation") - Matches java.langSuppressWarning with a single parameter. @org.junit.runner.RunWith(org.junit.runners.JUnit4.class) - Matches JUnit4's @RunWith(JUnit4.class)
-
Constructor Summary
ConstructorsConstructorDescriptionAnnotationMatcher
(String signature) AnnotationMatcher
(String signature, @Nullable Boolean matchesMetaAnnotations) -
Method Summary
Modifier and TypeMethodDescriptionboolean
matches
(org.openrewrite.java.tree.J.Annotation annotation) boolean
-
Constructor Details
-
AnnotationMatcher
-
AnnotationMatcher
-
-
Method Details
-
matches
public boolean matches(org.openrewrite.java.tree.J.Annotation annotation) -
matchesAnnotationOrMetaAnnotation
-