How do I parse script statements like ${value1==value2} using java?

for example, if I pass in a string ${value1==value2} , how can I use java to parse the meaning of value1 and value2 and get the calculation result, or how to identify the parameters value1 and value2 in this statement?

now I already know that using ScriptEngine , you can add the values of value1 and value2 to the value1==value2 formula according to the js syntax, but you still need to know the parameter name in the expression to replace

.

the requirement now is that after a series of operations, the values of several variables have been saved in a Map, and then you need to read a string s to parse and extract the variable values needed by s from Map to calculate, like this

.
valuesMap.put("value1", value1);
valuesMap.put("value2", value2);
...
String s = "value1==value2";
ScriptEngine engine = ...
//TODO svalueList
engine.put(valueList,get(i), valuesMap.get(valueList,get(i)));

how to solve the step of fetching the parameter list? Or what should I do to achieve this whole function?

May.25,2022

this also requires you to specify your real needs to see if there is a better solution, and sometimes you can't fix how to implement it.
if you have to implement the current solution, it would be nice for the circular map to use engine to define variables, but it feels like you need to understand the requirements more deeply to see if there is a more reasonable solution.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31da9-2bdb0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31da9-2bdb0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?