All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.hutool.extra.expression.engine.aviator.AviatorEngine Maven / Gradle / Ivy

There is a newer version: 5.8.33
Show newest version
package cn.hutool.extra.expression.engine.aviator;

import cn.hutool.extra.expression.ExpressionEngine;
import com.googlecode.aviator.AviatorEvaluator;
import com.googlecode.aviator.AviatorEvaluatorInstance;

import java.util.Map;

/**
 * Aviator引擎封装
* 见:https://github.com/killme2008/aviatorscript * * @author looly * @since 5.5.0 */ public class AviatorEngine implements ExpressionEngine { private final AviatorEvaluatorInstance engine; /** * 构造 */ public AviatorEngine() { engine = AviatorEvaluator.getInstance(); } @Override public Object eval(String expression, Map context) { return engine.execute(expression, context); } /** * 获取{@link AviatorEvaluatorInstance} * * @return {@link AviatorEvaluatorInstance} */ public AviatorEvaluatorInstance getEngine() { return this.engine; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy