public class JEPEmulationParser extends java.lang.Object implements ExpressionParser
JEPEmulationParser
class emulates a JEP syntax
parser JEPParser
using a high speed JEL parser JELParser
by translating the expression and emulating the output type
behaviour.ExpressionParser.ResultType
Constructor and Description |
---|
JEPEmulationParser()
Creates a new JEP emulation parser.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
evaluate(EvaluateImp evalImp)
Evaluates the expression to a primitive wrapper object.
|
double |
evaluateToDouble(EvaluateImp evalImp)
Evaluates the expression to a double value.
|
ExpressionParser.ResultType |
getResultType()
Gets the result data type.
|
java.util.List<java.lang.String> |
getVariables()
Gets the list of variables used in the expression.
|
void |
init(ParseImp parseImp)
Initializes this parser with the specified implementation.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
void |
parse(java.lang.String expr)
Parses the specified expression.
|
java.lang.String |
translate(java.lang.String expr)
Translates the specified expression to Java Language syntax if possible.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
adapt, evaluateToBoolean, evaluateToByte, evaluateToFloat, evaluateToInt, evaluateToLong, evaluateToShort, getParseTree, isThreadSafe
public JEPEmulationParser()
public void init(ParseImp parseImp)
ExpressionParser
init
in interface ExpressionParser
parseImp
- the parser implementation to use for variable information
during parsing.public java.lang.String translate(java.lang.String expr)
ExpressionParser
translate
in interface ExpressionParser
expr
- the expression to translate.public void parse(java.lang.String expr)
ExpressionParser
parse
in interface ExpressionParser
expr
- the expression to parse.public ExpressionParser.ResultType getResultType()
ExpressionParser
getResultType
in interface ExpressionParser
public java.util.List<java.lang.String> getVariables()
ExpressionParser
getVariables
in interface ExpressionParser
public java.lang.Object evaluate(EvaluateImp evalImp)
ExpressionParser
evaluate
in interface ExpressionParser
evalImp
- the evalutation implementation that provides variable
values.public double evaluateToDouble(EvaluateImp evalImp)
ExpressionParser
evaluateToDouble
in interface ExpressionParser
evalImp
- the evalutation implementation that provides variable
values.public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception