cn.hutool.extra.expression.engine.mvel.MvelEngine Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hutool-all Show documentation
Show all versions of hutool-all Show documentation
Hutool是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。
package cn.hutool.extra.expression.engine.mvel;
import cn.hutool.extra.expression.ExpressionEngine;
import org.mvel2.MVEL;
import java.util.Collection;
import java.util.Map;
/**
* MVEL (MVFLEX Expression Language)引擎封装
* 见:https://github.com/mvel/mvel
*
* @since 5.5.0
* @author looly
*/
public class MvelEngine implements ExpressionEngine {
static {
checkEngineExist(MVEL.class);
}
/**
* 构造
*/
public MvelEngine(){
}
@Override
public Object eval(String expression, Map context, Collection> allowClassSet) {
return MVEL.eval(expression, context);
}
private static void checkEngineExist(Class> clazz){
// do nothing
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy