com.github.liuyehcf.framework.expression.engine.ExpressionEngine Maven / Gradle / Ivy
package com.github.liuyehcf.framework.expression.engine;
import com.github.liuyehcf.framework.common.tools.asserts.Assert;
import com.github.liuyehcf.framework.expression.engine.compile.ExpressionCompiler;
import com.github.liuyehcf.framework.expression.engine.core.ExpressionCode;
import com.github.liuyehcf.framework.expression.engine.core.ExpressionException;
import com.github.liuyehcf.framework.expression.engine.core.function.DelegateOperatorFunction;
import com.github.liuyehcf.framework.expression.engine.core.function.Function;
import com.github.liuyehcf.framework.expression.engine.core.function.OperatorFunction;
import com.github.liuyehcf.framework.expression.engine.core.function.collection.CollectionIncludeFunction;
import com.github.liuyehcf.framework.expression.engine.core.function.collection.CollectionSizeFunction;
import com.github.liuyehcf.framework.expression.engine.core.function.date.DateTimestampFunction;
import com.github.liuyehcf.framework.expression.engine.core.function.math.*;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.add.AddOperatorFunctionForDouble;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.add.AddOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.add.AddOperatorFunctionForString;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.bitand.BitAndOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.bitor.BitOrOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.bitxor.BitXorOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.cmp.CmpOperatorFunctionForComparableObject;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.cmp.CmpOperatorFunctionForDouble;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.cmp.CmpOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.cmp.CmpOperatorFunctionForString;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.div.DivOperatorFunctionForDouble;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.div.DivOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.mul.MulOperatorFunctionForDouble;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.mul.MulOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.neg.NegOperatorFunctionForDouble;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.neg.NegOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.rem.RemOperatorFunctionForDouble;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.rem.RemOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.shl.ShlOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.shr.ShrOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.sub.SubOperatorFunctionForDouble;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.sub.SubOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.operator.ushr.UshrOperatorFunctionForLong;
import com.github.liuyehcf.framework.expression.engine.core.function.string.*;
import com.github.liuyehcf.framework.expression.engine.core.model.OperatorType;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import java.util.*;
/**
* @author hechenfeng
* @date 2018/9/26
*/
public abstract class ExpressionEngine {
/**
* Expression Compiler
*/
private static final ExpressionCompiler EXPRESSION_COMPILER = ExpressionCompiler.getInstance();
/**
* Normal Function Map
*/
private static final Map NORMAL_FUNCTIONS = Maps.newHashMap();
/**
* Operator Function Map
*/
private static final Map> OPERATOR_FUNCTIONS = Maps.newHashMap();
/**
* Expression Engine Option Map
*/
private static final Map