I don't think this can be done with any third party library directly. You may need to use some library like Antlr to write a translator to translate from your expression to your Java code.
java expression to logical operation [closed]
-
28-06-2022 - |
Question
Is there a way in java we can convert an expression (xml or any other) to logical operations.
for example I have a property
prop01=Achivment:APPCom,done&&TODO:getforecast,!done;Achivement done
is there a way I convert it to java code like
Map userData = getUserData();
Map achivements = userData.get("achivements");
Map TODOs = userData.get("TODOs");
String achiv = achivements.get("APPCom");
String todo = TODOs.get("getforecast");
if(achiv == "done" && todo != "done")
system.out.println("Achivement done"); // part after ; in expression
any third party available for this kind of task?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow