Structural search: matching methods with specific access scope Follow
I'd like to find all methods that have some annotation.
This is easy using SSR, there's even an existing template for that.
I didn't figure out these two things:
- How do I limit the results to methods with package-level access?
- Is it possible to limit the results to all non-public methods?
Thanks,
-tt
Please sign in to leave a comment.
You might set Groovy script constraint for method name like
'!__context__.modifierList.hasModifierProperty("public")'.
There is also special annotation for package level visibility, it is
present in predefined templates
Taras Tielkes wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Hi Maxim,
Thanks for the suggestion, I've found @Modifier("packageLocal"), and it works perfectly.
I'm using the 8.0 release build, and when performing a simple search for annotated methods, I get 2 hits for each occurrence. Is this a known problem, or should I file a new ticket?
The query I'm running is a simple as this:
----
class $Class$ {
@$Annotation$( )
$MethodType$ $MethodName$($ParameterType$ $ParameterName$);
}
----
$Annotation$ is set to some specific type, $MethodName$ is target of search.
Regards,
Taras
Seems like a bug.
Taras Tielkes wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"