Class SubtypeFilter

java.lang.Object
spoon.reflect.visitor.filter.AbstractFilter<CtType<?>>
spoon.reflect.visitor.filter.SubtypeFilter
All Implemented Interfaces:
Filter<CtType<?>>

public class SubtypeFilter extends AbstractFilter<CtType<?>>
Matches all CtType elements, which are sub type of superType Matches the input `superType` too. Call includingSelf(boolean) with value false, if instance of superType should no match this Filter
  • Constructor Details

  • Method Details

    • includingSelf

      public SubtypeFilter includingSelf(boolean includingSelf)
      Parameters:
      includingSelf - if false then element which is equal to to #superType is not matching
    • matches

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