CompilerBuilderImpl
public interface CompilerBuilder
Modifier and Type | Method | Description |
---|---|---|
Expression<?> |
compile() |
Compile the expression.
|
<T> Expression<T> |
compile(Type<T> type) |
Compile the expression with an expected result type.
|
CompilerBuilder |
withFunction(Function<?> function) |
Declare a
Function so that it's accessible from the expression. |
CompilerBuilder |
withOption(String key,
Object value) |
Enable a compiler option with the given value.
|
CompilerBuilder |
withVariable(String id,
Type type,
Variable<?> variable) |
Declare a
Variable so that it's accessible from the expression. |
CompilerBuilder |
withVariableFactory(VariableFactory variableFactory) |
Adds a
VariableFactory so that the compiler can instance new variables when needed. |
CompilerBuilder withOption(String key, Object value)
key
- Option namevalue
- Option valueCompilerBuilder withFunction(Function<?> function)
Function
so that it's accessible from the expression.function
- Function instance.CompilerBuilder withVariableFactory(VariableFactory variableFactory)
VariableFactory
so that the compiler can instance new variables when needed.variableFactory
- Variable factoryCompilerBuilder withVariable(String id, Type type, Variable<?> variable)
Variable
so that it's accessible from the expression.id
- Variable idtype
- Variable intermediatevariable
- Variable implementation<T> Expression<T> compile(Type<T> type) throws ParseException
T
- Value Java typetype
- Expected return typeParseException
- When the parsing fails or the expression cannot be converted to type.Expression<?> compile() throws ParseException
ParseException
- When the parsing fails or the expression cannot be converted to type.Copyright © 2019. All rights reserved.