KickJava   Java API By Example, From Geeks To Geeks.

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


1 package spoon.support.query;
2
3 import spoon.reflect.code.CtInvocation;
4 import spoon.reflect.reference.CtExecutableReference;
5
6 /**
7  * This simple filter matches all the accesses to a given executable or any
8  * executable that overrides it.
9  */

10 public class InvocationFilter extends AbstractFilter<CtInvocation<?>> {
11     CtExecutableReference executable;
12
13     /**
14      * Creates a new invocation filter.
15      *
16      * @param executable the executable to be tested for being invoked
17      */

18     public InvocationFilter(CtExecutableReference executable) {
19         super(CtInvocation.class);
20         this.executable = executable;
21     }
22
23     public boolean matches(CtInvocation<?> invocation) {
24         return invocation.getExecutable().isOverloading(executable);
25     }
26 }
Popular Tags