java - Resolve method call in annotation processor -


i want write annotation processor check method called in specific places. example:

interface command {     @mustonlybecalledbyworker     void execute(); }  class worker {     void work(command cmd) {         cmd.execute(); // ok annotation processor     } } class hacker {     void work(command cmd) {         cmd.execute(); // annotation processor gives error     } } 

i have annotation processor @supportedannotationtypes("*") uses compiler tree api methodinvocationtrees.

i thought there, declaration of called method.

now can method name , argument expressions.

but want distinguish between overloaded execute() methods same number of arguments. need handle whole overload resolution myself? think mean manually resolve static types of arguments, , in cases type arguments of other methods.

so here question: how can correct declaration of potentially overloaded method? maybe can somehow out of javactask?

i using intellij idea 14 , oracle's java 8 compiler. support language level 7 sufficient, solution java 8 support preferred.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -