Boolean Expression Evaluation in Java

前端 未结 10 1317
-上瘾入骨i
-上瘾入骨i 2020-12-05 16:26

I\'m looking for a relatively simpler (when compared with writing a parser) way to evaluate boolean expressions in Java, and I do not want to use the JEP library.

I

10条回答
  •  自闭症患者
    2020-12-05 16:48

    JUEL provides an implementation of Java's Unified Expression Language without being explicitly tied to JSP. Here's its Quick Start guide, expression evaluation (#3 on that page) is the part you're interested in.

    Alternatively, Spring 3.0 provides its own (though somewhat similar) expression language. This option only makes sense if you're already using Spring, though - I wouldn't pull it in just for EL.

提交回复
热议问题