Class DefaultExpressionParserEngine
java.lang.Object
ch.andre601.expressionparser.DefaultExpressionParserEngine
- All Implemented Interfaces:
ExpressionParserEngine
Class for a
A static createDefault() method is available to create a new instance of this class with default values applied for it to use.
ExpressionParserEngine instance to use.A static createDefault() method is available to create a new instance of this class with default values applied for it to use.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClass extendingExpressionParserEngine.BuilderwithDefaultExpressionParserEngine.Nested classes/interfaces inherited from interface ch.andre601.expressionparser.ExpressionParserEngine
ExpressionParserEngine.Builder<T extends ExpressionParserEngine> -
Constructor Summary
ConstructorsConstructorDescriptionDefaultExpressionParserEngine(List<TokenReader> tokenReaders, com.google.common.collect.ImmutableMap<Token, Operator> operators, com.google.common.collect.ImmutableList<ValueReader> valueReaders) Creates a new instance of this class. -
Method Summary
Modifier and TypeMethodDescriptioncompile(String text, ParseWarnCollector collector) Parses the provided text into aExpressionTemplateto use.Convenience method to create a new instance of this class with default values already applied.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.andre601.expressionparser.ExpressionParserEngine
compileToBoolean, compileToBoolean, compileToDouble, compileToDouble, compileToString, compileToString
-
Constructor Details
-
DefaultExpressionParserEngine
public DefaultExpressionParserEngine(List<TokenReader> tokenReaders, com.google.common.collect.ImmutableMap<Token, Operator> operators, com.google.common.collect.ImmutableList<ValueReader> valueReaders) Creates a new instance of this class.
The provided TokenReader list will be used to create a newExpressionTokenizerwhile the provided Map of Tokens and Operators and the List of ValueReaders will be used to create a newExpressionTemplateParser.- Parameters:
tokenReaders- List of TokenReaders to use.operators- Immutable Map of Token-Operator pairs to use.valueReaders- Immutable List of ValueReaders to use.
-
-
Method Details
-
createDefault
Convenience method to create a new instance of this class with default values already applied.
Calling this method is equal to calling new DefaultBuilder().addDefaults() followed byDefaultExpressionParserEngine.DefaultBuilder.build().- Returns:
- A new DefaultExpressionParserEngine with all values already applied.
-
compile
Parses the provided text into aExpressionTemplateto use.- Specified by:
compilein interfaceExpressionParserEngine- Parameters:
text- The text to parse into a ExpressionTemplate.collector- ParseWarnCollector instance used to collect warnings during the parsing.- Returns:
- New ExpressionTemplate to use.
-