As per the subject, I am trying to structurally search against all methods annotated with a specific annotation and with a specific return type.
To be clearer, if I have methods like the followings:
@MyAnnotation
public String myMethod1(){}
and
@MyAnnotation
public Integer myMethod2(){}
I would like to find a way to formulate a structural search in IntelliJ to find, e.g., "all methods annotated with @MyAnnotation
and with return type of String
" and such search would return only myMethod1()
.
I am using IntelliJ 13 Ultimate.
Thanks.
Using Structural Search, copy the existing template Methods of the class. Modify it as follows:
And edit the $ReturnType$ variable to specify Text/Regexp:
String
(or optionally to be really surejava\.lang\.String
)