Class DirectReferenceFilter<T extends CtReference>

java.lang.Object
spoon.reflect.visitor.filter.AbstractFilter<T>
spoon.reflect.visitor.filter.DirectReferenceFilter<T>
All Implemented Interfaces:
Filter<T>

public class DirectReferenceFilter<T extends CtReference> extends AbstractFilter<T>
A filter for CtReferences that compare equal to the reference provided in the constructor. Note that this does not cover all references to the pointed-to element. If the reference to search for refers to a field, for example, type information is part of the CtVariableReference. This will cause searches for generic fields to turn up short, as references with a known type are different.
  • Constructor Details

    • DirectReferenceFilter

      public DirectReferenceFilter(CtReference reference)
      Creates the filter.
      Parameters:
      reference - the matching reference
  • Method Details

    • matches

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