Class ExpressionParser<TYPE>

java.lang.Object
com.illumon.iris.db.tables.utils.ExpressionParser<TYPE>
Type Parameters:
TYPE - The expected type of the parsed expression

public class ExpressionParser<TYPE>
extends Object
A parser that will try a set of ExpressionFactorys and attempt to parse the expression until one of them succeeds.
  • Constructor Details

  • Method Details

    • parse

      @NotNull public TYPE parse​(String expression, Object... args)
      Attempt to process the expression using the configured factories
      Parameters:
      expression - the expression to parse
      Returns:
      The result of the parsing
      Throws:
      ExpressionException - if there is a problem parsing the expression, or no parsers accepted the expression.
    • registerFactory

      public void registerFactory​(ExpressionFactory<TYPE> expressionFactory)
      Add an expression factory to the list of possible parsers for an expression.
      Parameters:
      expressionFactory - the factory