aviator表达式引擎使用

pom依赖:

        
        
            cn.hutool
            hutool-all
            5.5.1
        

        
        
            com.googlecode.aviator
            aviator
            5.3.3
        

测试类:

@Test
public void test3(){
    try {
        Map map = new HashMap<>();
        map.put("psiDescription","abc");
        String expStr = "!string.contains(psiDescription, 750)";
        Expression exp = AviatorEvaluator.compile(expStr, true);
        Object result = exp.execute(map);
        System.out.println(result);
    } catch (Exception e) {
        log.error("testIsTrue error: {}", e.getMessage(), e);
    }
}

你可能感兴趣的:(java)