Class AnnotationMatcher


  • public class AnnotationMatcher
    extends java.lang.Object
    This matcher will find all annotations matching the annotation pattern

    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#...)

  • The annotationClass must be fully qualified.
  • The parameter name/value pairs can be in any order
  •  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") - Exaclty the same results from the previous example, order of parameters does not matter. @java.lang.SuppressWarnings("deprecation") - Matches java.langSupressWarning with a single parameter. @org.junit.runner.RunWith(org.junit.runners.JUnit4.class) - Matches JUnit4's @RunWith(JUnit4.class)