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

4 comments
Comment actions Permalink

Thanks, it helped.

0
Comment actions Permalink

@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.

0
Comment actions Permalink

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

0

Please sign in to leave a comment.