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.
  • Method Details

    • compile

      ExpressionTemplate compile(String text, ParseWarnCollector collector)
      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

      default boolean compileToBoolean(String text, ParseWarnCollector collector)
      Parses the provided text into a ExpressionTemplate and returns its boolean value to use.
      Should the ExpressionTemplate be null will false be used. Use compileToBoolean(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

      default boolean compileToBoolean(String text, ParseWarnCollector collector, boolean def)
      Parses the provided text into a ExpressionTemplate and returns its boolean value to use.
      Should the ExpressionTemplate be null will the provided default boolean value be used.
      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

      default double compileToDouble(String text, ParseWarnCollector collector)
      Parses the provided text into a ExpressionTemplate and returns its double value to use.
      Should the ExpressionTemplate be null will 0.0 be used. Use compileToDouble(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

      default double compileToDouble(String text, ParseWarnCollector collector, double def)
      Parses the provided text into a ExpressionTemplate and returns its double value to use.
      Should the ExpressionTemplate be null will the provided default double value be used.
      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

      default String compileToString(String text, ParseWarnCollector collector)
      Parses the provided text into a ExpressionTemplate and returns its String value to use.
      Should the ExpressionTemplate be null will an empty String be used. Use compileToString(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

      default String compileToString(String text, ParseWarnCollector collector, String def)
      Parses the provided text into a ExpressionTemplate and returns its String value to use.
      Should the ExpressionTemplate be null will the provided default String value be used.
      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.