How to evaluate expressions given as parameter
Sometimes it comes in handy to evaluate an expression given as a parameter, to leave open certain parts of the application (how a particular formula is calculated, the set of business rules of the application, etc.). For this, the Spring Expression Parser comes to rescue. Here are two references I've used to implement my own case.
The documentation of Spring, despite is large, is good:
And here is a more concise explanation: