public class ExpressionBuilder extends Object
Expression instances. This class is the main API entrypoint. Users should create new
Expression instances using this factory class.| 构造器和说明 |
|---|
ExpressionBuilder(String expression)
Create a new ExpressionBuilder instance and initialize it with a given expression string.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Expression |
build()
Build the
Expression instance using the custom operators and functions set. |
ExpressionBuilder |
function(Function function)
Add a
Function implementation available for use in the expression |
ExpressionBuilder |
functions(Function... functions)
Add multiple
Function implementations available for use in the expression |
ExpressionBuilder |
functions(List<Function> functions)
Add multiple
Function implementations available for use in the expression |
ExpressionBuilder |
implicitMultiplication(boolean enabled) |
ExpressionBuilder |
operator(List<Operator> operators)
Add multiple
Operator implementations which should be available for use in the expression |
ExpressionBuilder |
operator(Operator... operators)
Add multiple
Operator implementations which should be available for use in the expression |
ExpressionBuilder |
operator(Operator operator)
Add an
Operator which should be available for use in the expression |
ExpressionBuilder |
variable(String variableName)
Declare a variable used in the expression
|
ExpressionBuilder |
variables(Set<String> variableNames)
Declare variable names used in the expression
|
ExpressionBuilder |
variables(String... variableNames)
Declare variable names used in the expression
|
public ExpressionBuilder(String expression)
expression - the expression to be parsedpublic ExpressionBuilder function(Function function)
Function implementation available for use in the expressionfunction - the custom Function implementation that should be available for use in the expression.public ExpressionBuilder functions(Function... functions)
Function implementations available for use in the expressionfunctions - the custom Function implementationspublic ExpressionBuilder functions(List<Function> functions)
Function implementations available for use in the expressionpublic ExpressionBuilder variables(Set<String> variableNames)
variableNames - the variables used in the expressionpublic ExpressionBuilder variables(String... variableNames)
variableNames - the variables used in the expressionpublic ExpressionBuilder variable(String variableName)
variableName - the variable used in the expressionpublic ExpressionBuilder implicitMultiplication(boolean enabled)
public ExpressionBuilder operator(Operator operator)
Operator which should be available for use in the expressionoperator - the custom Operator to addpublic ExpressionBuilder operator(Operator... operators)
Operator implementations which should be available for use in the expressionoperators - the set of custom Operator implementations to addpublic ExpressionBuilder operator(List<Operator> operators)
Operator implementations which should be available for use in the expressionpublic Expression build()
Expression instance using the custom operators and functions set.Expression instance which can be used to evaluate the result of the expressionCopyright © 2025. All rights reserved.