Say , i have List of Emp object with name, age and salary attribute .
List<Emp> empObj = readEmpDetails();
Keeping filter condition from DB or read from flat file. But syntax like below format.
name contains mike
age gt 100
How can i convert list of above condition to java expression . need to perform this condition against empObj which we read from DB source. How can i do this ? Please share your experience.
2
Answers
Based on your request, I’ll make code like the following.
The following code is second way after I checked you reply.
You could use Spring Spel (
org.springframework.expression.ExpressionParser
):Output:
Types of literals and operations are: