Class AbstractFilter<T extends CtElement>

java.lang.Object
spoon.reflect.visitor.filter.AbstractFilter<T>
All Implemented Interfaces:
Filter<T>
Direct Known Subclasses:
AbstractReferenceFilter, DirectReferenceFilter, SubtypeFilter, TypeFilter

public abstract class AbstractFilter<T extends CtElement> extends Object implements Filter<T>
Defines an abstract filter based on matching on the element types. Not necessary in simple cases thanks to the use of runtime reflection.
  • Constructor Details

    • AbstractFilter

      public AbstractFilter(Class<? super T> type)
      Creates a filter with the type of the potentially matching elements.
    • AbstractFilter

      public AbstractFilter()
      Creates a filter with the type computed by reflection from the matches method parameter
  • Method Details

    • getType

      public Class<T> getType()
    • matches

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