package com.yeejoin.amos.fas.business.util;

import org.apache.commons.jexl2.Expression;
import org.apache.commons.jexl2.JexlEngine;

public class JexlUtil {

    public static boolean convertToCode(String jexlExp) {
        JexlEngine jexl = new JexlEngine();
        Expression e = jexl.createExpression(jexlExp);
        Object object = e.evaluate(null);
        if (null == object) {
            return false;
        }
        return Boolean.valueOf(object.toString());
    }

}
