Spring Expression Language in custom annotations.
Answered
Hello guys,
I wondering if there is a way to force IDEA to treat strings in custom annotations as SpEL expressions, like it does in @PreAuthorize#value field.
Thanks
Please sign in to leave a comment.
See https://www.jetbrains.com/help/idea/using-language-injections.html.
Thanks, it helped.
@Serge, is there a way to configure IDEA to always (in all projects) treat attributes of certain annotations as SpEL? For example out of the box, IDEA does not syntax highlight SpEL inside org.springframework.kafka.annotation.KafkaListener#topics.
Hi guys, by the way the only way it worked for me is alt+enter and inject SpEL into my IDEA, however I would like that any other developer from my team see that string as SpEL expression.
The comment above the Annotation method declaration, didn't work // language=Spring EL
Finally discovered the solution ("SpEL instead of Spring EL) after using IntelliSense to get suggestions for the Language annotation's String.