|
@@ -3,10 +3,13 @@ package com.persagy.utils;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.googlecode.aviator.AviatorEvaluator;
|
|
|
|
+import com.googlecode.aviator.Expression;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.lang.reflect.Array;
|
|
import java.lang.reflect.Array;
|
|
|
|
+import java.math.BigDecimal;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Pattern;
|
|
import java.util.regex.Pattern;
|
|
@@ -444,4 +447,14 @@ public class StringUtil {
|
|
return isEmpty(obj) ? false : Boolean.valueOf(obj.toString());
|
|
return isEmpty(obj) ? false : Boolean.valueOf(obj.toString());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static void main(String[] args) {
|
|
|
|
+ JSONObject paramMap = new JSONObject();
|
|
|
|
+ paramMap.put("hello",6);
|
|
|
|
+ paramMap.put("X",6.0);
|
|
|
|
+ paramMap.put("Y",6.0);
|
|
|
|
+ String exp = "X < seq.min(seq.list(decimal(1), decimal(2.5), decimal(hello), decimal(3.14)))";
|
|
|
|
+ Expression expExp = AviatorEvaluator.compile(exp, true);
|
|
|
|
+ Boolean triggerResult = (Boolean) expExp.execute(paramMap);
|
|
|
|
+ System.out.println("triggerResult:"+triggerResult);
|
|
|
|
+ }
|
|
}
|
|
}
|