Class AnnotationFilter<E extends CtElement>

All Implemented Interfaces:
Filter<E>

public class AnnotationFilter<E extends CtElement> extends TypeFilter<E>
This filter matches all the elements annotated with a given annotation type.
  • Constructor Details

    • AnnotationFilter

      public AnnotationFilter(Class<? extends Annotation> annotationType)
      Creates the filter.
      Parameters:
      annotationType - the annotation type which is searched
    • AnnotationFilter

      public AnnotationFilter(Class<E> elementType, Class<? extends Annotation> annotationType)
      Creates a new annotation filter.
  • Method Details

    • matches

      public boolean matches(E element)
      Description copied from interface: Filter
      Tells if the given element matches.
      Specified by:
      matches in interface Filter<E extends CtElement>
      Overrides:
      matches in class AbstractFilter<E extends CtElement>
      Parameters:
      element - - the element to be checked for a match. Parameter element is never null if Query is used.