In Spring expression language (SpEL) each textual relational operator has a symbolic equivalent. For example, eq can be written as ==, and lt can be written as < (source here).
The logical operators, however, don’t have a symbolic equivalent – at least as far as I can tell. I have to use and and or, the expected notation of & and | is just not there (for some reason not is different, it has the ! equivalent).
Any idea if & and | are available, or if it is possible to extend Spring to support them?
You have to take a look at
org.springframework.expression.spel.standard.Tokenizerin methodprocess()where you will realize |, &, || and && are not supported. Adding this would require to subclass the Tokenizer and also to subclass theorg.springframework.expression.spel.standard.InternalSpelExpressionParserbecause in its .doParseExpression()` method the Tokenizer is instantiated directly… Source of Spring 3.1 version was taken by me.