Interface ExpressionParserEngine
- All Known Implementing Classes:
DefaultExpressionParserEngine
public interface ExpressionParserEngine
This interface can be used to create multiple Expression parsers, all using the same core stuff.
It is not required to use this at all.
It is not required to use this at all.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classAbstract class that can be used to create a new Builder for aExpressionParserEngine. -
Method Summary
Modifier and TypeMethodDescriptioncompile(String text, ParseWarnCollector collector) Converts the provided String into a ExpressionTemplate instance to use.default booleancompileToBoolean(String text, ParseWarnCollector collector) Parses the provided text into aExpressionTemplateand returns itsbooleanvalue to use.default booleancompileToBoolean(String text, ParseWarnCollector collector, boolean def) Parses the provided text into aExpressionTemplateand returns itsbooleanvalue to use.default doublecompileToDouble(String text, ParseWarnCollector collector) Parses the provided text into aExpressionTemplateand returns itsdoublevalue to use.default doublecompileToDouble(String text, ParseWarnCollector collector, double def) Parses the provided text into aExpressionTemplateand returns itsdoublevalue to use.default StringcompileToString(String text, ParseWarnCollector collector) Parses the provided text into aExpressionTemplateand returns itsStringvalue to use.default StringcompileToString(String text, ParseWarnCollector collector, String def) Parses the provided text into aExpressionTemplateand returns itsStringvalue to use.
-
Method Details
-
compile
Converts the provided String into a ExpressionTemplate instance to use.- Parameters:
text- The text to parse into a ExpressionTemplate.collector- ParseWarnCollector instance used to collect warnings during the parsing.- Returns:
- Possibly-null ExpressionTemplate instance.
-
compileToBoolean
Parses the provided text into aExpressionTemplateand returns itsbooleanvalue to use.
Should the ExpressionTemplate be null willfalsebe returned. UsecompileToBoolean(String,ParseWarnCollector,boolean)to change the default boolean.- Parameters:
text- The text to parse.collector- ParseWarnCollector instance used to collect warnings during the parsing.- Returns:
- boolean value from the parsed ExpressionTemplate.
-
compileToBoolean
Parses the provided text into aExpressionTemplateand returns itsbooleanvalue to use.
Should the ExpressionTemplate be null will the provided default boolean value be returned.- Parameters:
text- The text to parse.collector- ParseWarnCollector instance used to collect warnings during the parsing.def- Default boolean value to use should ExpressionTemplate returned be null.- Returns:
- boolean value from the parsed ExpressionTemplate.
-
compileToDouble
Parses the provided text into aExpressionTemplateand returns itsdoublevalue to use.
Should the ExpressionTemplate be null will0.0be returned. UsecompileToDouble(String,ParseWarnCollector,double)to change the default double.- Parameters:
text- The text to parse.collector- ParseWarnCollector instance used to collect warnings during the parsing.- Returns:
- double value from the parsed ExpressionTemplate.
-
compileToDouble
Parses the provided text into aExpressionTemplateand returns itsdoublevalue to use.
Should the ExpressionTemplate be null will the provided default double value be returned.- Parameters:
text- The text to parse.collector- ParseWarnCollector instance used to collect warnings during the parsing.def- Default double value to use should ExpressionTemplate returned be null.- Returns:
- double value from the parsed ExpressionTemplate.
-
compileToString
Parses the provided text into aExpressionTemplateand returns itsStringvalue to use.
Should the ExpressionTemplate be null will an empty String be returned. UsecompileToString(String,ParseWarnCollector,String)to change the default String.- Parameters:
text- The text to parse.collector- ParseWarnCollector instance used to collect warnings during the parsing.- Returns:
- String value from the parsed ExpressionTemplate.
-
compileToString
Parses the provided text into aExpressionTemplateand returns itsStringvalue to use.
Should the ExpressionTemplate be null will the provided default String value be returned.- Parameters:
text- The text to parse.collector- ParseWarnCollector instance used to collect warnings during the parsing.def- Default String value to use should ExpressionTemplate returned be null.- Returns:
- String value from the parsed ExpressionTemplate.
-