KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > spoon > support > query > AbstractFilter


1 package spoon.support.query;
2
3 import spoon.reflect.declaration.CtElement;
4 import spoon.reflect.visitor.Filter;
5
6 /**
7  * This class defines an abstract filter that needs to be subclassed in order to
8  * define the matching criteria.
9  *
10  * @see spoon.reflect.visitor.Filter#matches(CtElement)
11  */

12 public abstract class AbstractFilter<T extends CtElement> implements Filter<T> {
13
14     Class JavaDoc<T> type;
15
16     /**
17      * Creates a filter with the type of the potentitally matching elements.
18      */

19     @SuppressWarnings JavaDoc("unchecked")
20     public AbstractFilter(Class JavaDoc<?> type) {
21         this.type = (Class JavaDoc<T>) type;
22     }
23
24     public Class JavaDoc<T> getType() {
25         return type;
26     }
27
28 }
29
Popular Tags