Last active
August 9, 2019 07:11
-
-
Save stormwy/3afd0649d97ed3c248a352ef2cdfef41 to your computer and use it in GitHub Desktop.
[java] aviator example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.googlecode.aviator.AviatorEvaluator; | |
| import com.googlecode.aviator.Expression; | |
| import java.util.HashMap; | |
| import java.util.Map; | |
| public class TestAviator { | |
| public static void main(String[] args) { | |
| Expression compiledExp = AviatorEvaluator.compile("100<a && a<200",true); | |
| Map<String,Object> factorMap = new HashMap<>(); | |
| factorMap.put("a",300); | |
| System.out.println(compiledExp.execute(factorMap)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment