Package com.illumon.iris.db.tables.utils
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
ExpressionFactory
s and attempt to parse the expression until one of them succeeds.-
Constructor Summary
Constructors Constructor Description ExpressionParser()
-
Method Summary
Modifier and Type Method Description TYPE
parse(String expression, Object... args)
Attempt to process the expression using theconfigured
factories
void
registerFactory(ExpressionFactory<TYPE> expressionFactory)
Add an expression factory to the list of possible parsers for an expression.
-
Constructor Details
-
ExpressionParser
public ExpressionParser()
-
-
Method Details
-
parse
Attempt to process the expression using theconfigured
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
Add an expression factory to the list of possible parsers for an expression.- Parameters:
expressionFactory
- the factory
-