1 package spoon.reflect.visitor; 2 3 import spoon.reflect.reference.CtReference; 4 5 /** 6 * This interface defines a filter for program element references. 7 * 8 * @param T the type of the filtered references (an reference belonging to the 9 * filtered element must be assignable from <code>T</code>). 10 */ 11 public interface ReferenceFilter<T extends CtReference> { 12 /** 13 * Tells if the given reference matches. 14 */ 15 boolean matches(T reference); 16 /** 17 * Gets the runtime type that corresponds to the <code>T</code> parameter 18 * (the type of the filtered references). Any reference assignable from this 19 * type is a potential match and is tested using the {@link #matches(CtReference)} 20 * method, while other references are never a match. 21 */ 22 Class<T> getType(); 23 } 24