|
|||||||||
| Home >> All >> org >> ujac >> util >> [ exi overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.ujac.util.exi
Class ExpressionInterpreter

java.lang.Objectorg.ujac.util.exi.ExpressionInterpreter
- public class ExpressionInterpreter
- extends java.lang.Object
Title: ExpressionInterpreter
Description: Interpreter for expressions fitting into the following syntax.
Basically an expression consists of an object, an operation and an operand: ${object operation operand}
The operation and the operand are optional.
The object can be an expression itself, so encapsulation of expressions is possible.
Example: ${${today decrYear 1} getYear} produces a String containing the value of last year (currently 2001).
Operations can be operators as well. Supported operators are +, -, / and * for mathematical operations.
Additional there are two operators '.' and '->' which can be used to reference a property on an object.
The special thing about operators is, that they do not need to be separated from the object and the operand.
So is for example the expression ${test+10} valid, in case the object test contains a numeric object.
List of currently supported operations for Date values:
incrYear: used to increment the refering date by an amount of years.
incrMonth: used to increment the refering date by an amount of months.
incrDay: used to increment the refering date by an amount of days.
decrYear: used to decrement the refering date by an amount of years.
decrMonth: used to decrement the refering date by an amount of months.
decrDay: used to decrement the refering date by an amount of days.
min: used to determine the minimum value of object and operand.
max: used to determine the maximum value of object and operand.
prevUltimo: used to determine the previous ultimo date of the refering date.
nextUltimo: used to determine the next ultimo date of the refering date.
getYear: used to fetch the year from the refering date.
getMonth: used to fetch the month from the refering date.
getDay: used to fetch the day from the refering date.
properties, accessible by reference operator:
year: Same as getYear
month: Same as getMonth
day: Same as getDay
List of currently supported operations for String values:
length: used to fetch the length from the refering string.
List of currently supported operations for Integer values:
min: used to determine the minimum value of object and operand.
max: used to determine the maximum value of object and operand.
add or +: used to add the value of the operand to the object.
sub or -: used to substract the value of the operand from the object.
mul or *: used to multiply the value of the operand with the object.
div or /: used to divide the operand value from the object's value.
List of currently supported operations for Long values:
min: used to determine the minimum value of object and operand.
max: used to determine the maximum value of object and operand.
add or +: used to add the value of the operand to the object.
sub or -: used to substract the value of the operand from the object.
mul or *: used to multiply the value of the operand with the object.
div or /: used to divide the operand value from the object's value.
List of currently supported operations for Double values:
min: used to determine the minimum value of object and operand.
max: used to determine the maximum value of object and operand.
add or +: used to add the value of the operand to the object.
sub or -: used to substract the value of the operand from the object.
mul or *: used to multiply the value of the operand with the object.
div or /: used to divide the operand value from the object's value.
Log: $Log: ExpressionInterpreter.java,v $
Log: Revision 1.43 2003/12/02 21:36:32 lauerc
Log: Fixed comparison operator parsing.
Log:
Log: Revision 1.42 2003/11/23 03:23:39 lauerc
Log: Cleaned up code.
Log: Fixed javadoc comments.
Log:
Log: Revision 1.41 2003/11/22 01:48:42 lauerc
Log: Added support for resource bundles.
Log:
Log: Revision 1.40 2003/11/01 12:06:38 lauerc
Log: Added copyright notice.
Log:
Log: Revision 1.39 2003/11/01 01:52:39 lauerc
Log: At method parseOperand: added support for operator token '!'.
Log:
Log: Revision 1.38 2003/10/30 23:41:50 lauerc
Log: Fixed bugs in statement handling.
Log:
Log: Revision 1.37 2003/10/29 00:15:15 lauerc
Log: Removed unneccessary imports.
Log:
Log: Revision 1.36 2003/10/29 00:11:24 lauerc
Log: Fixed evaluation of procedures at method evalStatement.
Log: Removed main method, performing tests in jUnit test classes now.
Log:
Log: Revision 1.35 2003/10/28 07:08:09 lauerc
Log: Added support for procedures.
Log:
Log: Revision 1.34 2003/10/13 19:12:19 lauerc
Log: Fixed method evalBoolean: In case of non Boolean expression result parsing boolean value from expression result instead of expression code.
Log:
Log: Revision 1.33 2003/10/07 23:53:56 lauerc
Log: Removed unneccessary else branch at method evalStringOperand.
Log:
Log: Revision 1.32 2003/10/04 21:07:40 lauerc
Log: Implemented type handling in a smarter way at method evalStringOperand.
Log:
Log: Revision 1.31 2003/10/04 00:18:17 lauerc
Log: Improved localization.
Log:
Log: Revision 1.30 2003/10/03 06:59:47 lauerc
Log: Added localization test to main method.
Log:
Log: Revision 1.29 2003/10/02 23:58:59 lauerc
Log: Added localization support to expression interpreter.
Log:
Log: Revision 1.28 2003/09/28 15:38:23 lauerc
Log: Fixed javadoc comments.
Log:
Log: Revision 1.27 2003/09/03 18:47:15 lauerc
Log: Fixed number formatting at method evalStringOperand.
Log:
Log: Revision 1.26 2003/09/02 19:44:39 lauerc
Log: Added support for MapType.
Log:
Log: Revision 1.25 2003/08/29 05:11:05 lauerc
Log: Considering inner encapsulations now (Changes at methods parseExpr and parseOperand).
Log: Allowed multiple evaluations of expressions to make stuff like the _foreach_ statement work correctly.
Log:
Log: Revision 1.24 2003/08/29 04:49:43 lauerc
Log: Added support for Collection type handler.
Log:
Log: Revision 1.23 2003/07/28 23:11:46 lauerc
Log: Redesigned expression parsing.
Log: Implemented priority rules for operators.
Log: Removed unneccessary usage of StringBuffer to gain better performance.
Log:
Log: Revision 1.22 2003/07/26 15:59:33 lauerc
Log: Fixed statement processing.
Log:
Log: Revision 1.21 2003/07/23 22:38:23 lauerc
Log: Added missing support for boolean specific 'getters' with
Log: common form 'isXyz' at method getParameterValues.
Log:
Log: Revision 1.20 2003/07/23 21:34:16 lauerc
Log: Added support for Arrays at _foreach_ statement evaluation.
Log:
Log: Revision 1.19 2003/07/15 21:50:59 lauerc
Log: Improved result handling at method evalStringExpr.
Log: Statement handling stuff (methods scanForStatements + evalStatement) rewritten.
Log: Fixed handling of constant values at method parseOperand.
Log:
Log: Revision 1.18 2003/07/11 22:34:48 lauerc
Log: Fixed method getTypeHandler: If the type of the object doesn't match an registered type,
Log: checking the compability of the type with the registered types.
Log: If all failed, using default type.
Log:
Log: Revision 1.17 2003/05/20 21:19:31 lauerc
Log: Enhanced exception handling: Added the expression code to the message for easier problem identification.
Log: Changed behaviour at eval methods for primitives: In case the expression resolved to null, returning the default value, not throwing an exception anymore.
Log:
Log: Revision 1.16 2003/05/10 09:24:46 lauerc
Log: Fixed incompabilities with JDK 1.3.
Log: Added support for BigDecimal type.
Log:
Log: Revision 1.15 2003/04/29 05:32:18 lauerc
Log: Added support for Float type.
Log: Made number processing more error tolerant.
Log:
Log: Revision 1.14 2003/04/26 00:45:03 lauerc
Log: Removed previously added exception at method evalObject, returning the given text instead.
Log:
Log: Revision 1.13 2003/04/26 00:22:04 lauerc
Log: Throwing an exception in case no expression was detected in method evalObject instead of letting the method run into the NullPointerException knife.
Log:
Log: Revision 1.12 2003/03/20 07:05:15 lauerc
Log: Fixed bug at output of static text at eval method.
Log:
Log: Revision 1.11 2003/03/17 23:40:46 lauerc
Log: Added capability for streaming the expression output at method eval by passing a writer instance as argument.
Log:
Log: Revision 1.10 2003/03/17 20:28:18 lauerc
Log: Registered IntegerType for new class SequenceIndex.
Log: Setting sequence index variable when evaluating sequences.
Log:
Log: Revision 1.9 2003/03/17 07:58:38 lauerc
Log: Enhanced support for _if_ and _foreach_ statements.
Log:
Log: Revision 1.8 2003/03/16 01:46:57 lauerc
Log: Identificating the expression types by their class now.
Log: Initial support for statements, they do provide conditional execution of expressions at the eval method,
Log: (_if_ statement) and iterations (_foreach_ statement).
Log:
Log: Revision 1.7 2003/03/13 00:28:20 lauerc
Log: Added support for table type.
Log:
Log: Revision 1.6 2003/03/11 06:35:00 lauerc
Log: Added better support for type formats.
Log:
Log: Revision 1.5 2003/03/09 14:13:29 lauerc
Log: Cleaned up code.
Log:
Log: Revision 1.4 2003/03/09 14:08:50 lauerc
Log: Performance tuning:
Log: - Changed type of source to char array.
Log: - Reimplemented method scanExpression.
Log:
Log: Revision 1.3 2003/03/08 18:12:17 lauerc
Log: Passing the total position and length of an expression to its nested expressions.
Log:
Log: Revision 1.2 2003/03/08 16:55:58 lauerc
Log: Completely reimplemented parser.
Log:
Log: Revision 1.1 2003/03/05 06:23:25 lauerc
Log: Initial revision.
Log:
- Version:
- $Revision: 1.43 $
| Field Summary | |
static java.lang.Class |
DEFAULT_TYPE
The name of the default type handler. |
private org.ujac.util.text.FormatHelper |
formatHelper
The format helper to use. |
private boolean |
formatTableValues
A flag which defines, whether BXTable fields are returned as formatted Strings, or their defineddata types are considered for returning values. |
static java.lang.Class[] |
GETTER_ARG_TYPES
The argument type list for a getter method. |
static java.lang.Object[] |
GETTER_ARGS
The argument list for a getter method. |
private static java.util.Map |
operationPriorityMap
The operation priority map. |
static int |
PS_OBJECT
Constant for the parse state 'object'. |
static int |
PS_OPERAND
Constant for the parse state 'operand'. |
static int |
PS_OPERATION
Constant for the parse state 'operation'. |
private java.util.Map |
typeHandlers
A map holding the registered type handlers by their names. |
| Constructor Summary | |
ExpressionInterpreter()
Constructs an ExpressionInterpreter instance with no specific attributes. |
|
ExpressionInterpreter(org.ujac.util.text.FormatHelper formatHelper)
Constructs an ExpressionInterpreter instance with no specific attributes. |
|
| Method Summary | |
private void |
callProcedure(ProcedureInfo procInfo,
java.util.List arguments,
java.io.Writer writer,
int level,
java.util.Map params,
java.lang.Object bean)
Calls the given procedure |
private static Operation |
checkOperation(java.lang.String name)
Chooses the priority of the given operation. |
private java.util.Map |
cloneParams(java.util.Map params)
Clones the given parameter map. |
void |
eval(char[] text,
java.io.Writer writer,
int firstPos,
int lastPos,
java.util.List tokens,
int level,
java.util.Map params,
java.lang.Object bean)
Evaluates a text, which is likely to contain expressions. |
java.lang.String |
eval(java.lang.String text,
java.util.Map params)
Evaluates a text, which is likely to contain expressions. |
java.lang.String |
eval(java.lang.String text,
java.util.Map params,
java.lang.Object bean)
Evaluates a text, which is likely to contain expressions. |
void |
eval(java.lang.String text,
java.io.Writer writer,
java.util.Map params)
Evaluates a text, which is likely to contain expressions. |
void |
eval(java.lang.String text,
java.io.Writer writer,
java.util.Map params,
java.lang.Object bean)
Evaluates a text, which is likely to contain expressions. |
boolean |
evalBoolean(java.lang.String text,
java.util.Map params)
Evaluates a text, which is likely to contain expressions as a Boolean. |
boolean |
evalBoolean(java.lang.String text,
java.util.Map params,
java.lang.Object bean)
Evaluates a text, which is likely to contain expressions as a Boolean. |
boolean |
evalBooleanOperand(Operand operand,
java.util.Map params,
java.lang.Object bean)
Evaluates an expression as a boolean value. |
java.util.Date |
evalDate(java.lang.String text,
java.util.Map params)
Evaluates a text, which is likely to contain expressions as a Date. |
java.util.Date |
evalDate(java.lang.String text,
java.util.Map params,
java.lang.Object bean)
Evaluates a text, which is likely to contain expressions as a Date. |
java.util.Date |
evalDateOperand(Operand operand,
java.util.Map params,
java.lang.Object bean)
Evaluates an expression as an Date value. |
double |
evalDouble(java.lang.String text,
java.util.Map params)
Evaluates a text, which is likely to contain expressions as a double. |
double |
evalDouble(java.lang.String text,
java.util.Map params,
java.lang.Object bean)
Evaluates a text, which is likely to contain expressions as a double. |
double |
evalDoubleOperand(Operand operand,
java.util.Map params,
java.lang.Object bean)
Evaluates an expression as an double value. |
java.lang.Object |
evalExpr(ExpressionTuple expr,
java.util.Map params,
java.lang.Object bean)
Evaluates an expression. |
float |
evalFloat(java.lang.String text,
java.util.Map params)
Evaluates a text, which is likely to contain expressions as a float. |
float |
evalFloat(java.lang.String text,
java.util.Map params,
java.lang.Object bean)
Evaluates a text, which is likely to contain expressions as a double. |
float |
evalFloatOperand(Operand operand,
java.util.Map params,
java.lang.Object bean)
Evaluates an expression as an float value. |
int |
evalInt(java.lang.String text,
java.util.Map params)
Evaluates a text, which is likely to contain expressions as an integer. |
int |
evalInt(java.lang.String text,
java.util.Map params,
java.lang.Object bean)
Evaluates a text, which is likely to contain expressions as an int. |
int |
evalIntOperand(Operand operand,
java.util.Map params,
java.lang.Object bean)
Evaluates an expression as an integer value. |
long |
evalLong(java.lang.String text,
java.util.Map params)
Evaluates a text, which is likely to contain expressions as a long. |
long |
evalLong(java.lang.String text,
java.util.Map params,
java.lang.Object bean)
Evaluates a text, which is likely to contain expressions as an long. |
long |
evalLongOperand(Operand operand,
java.util.Map params,
java.lang.Object bean)
Evaluates an expression as an long value. |
java.lang.Object |
evalObject(java.lang.String text,
java.util.Map params)
Evaluates a text, which is likely to contain expressions as an Object. |
java.lang.Object |
evalObject(java.lang.String text,
java.util.Map params,
java.lang.Object bean)
Evaluates a text, which is likely to contain expressions as an Object. |
java.lang.Object |
evalOperand(Operand operand,
java.util.Map params,
java.lang.Object bean)
Evaluates an operand. |
private void |
evalStatement(StatementInfo stmtInfo,
java.io.Writer writer,
char[] text,
int level,
java.util.Map params,
java.lang.Object bean)
Evaluates the given statement. |
java.lang.String |
evalStringOperand(Operand operand,
java.util.Map params,
java.lang.Object bean)
Evaluates an expression as a String value. |
java.lang.String |
getConstantValue(java.lang.String constant)
Parses constant from given text. |
java.text.DateFormat |
getDateFormat()
Gets the current date format. |
java.text.NumberFormat |
getDoubleFormat()
Gets the current double format. |
org.ujac.util.text.FormatHelper |
getFormatHelper()
Gets the used format helper. |
boolean |
getFormatTableValues()
Getter method for the flag formatTableValues. |
java.text.NumberFormat |
getIntegerFormat()
Gets the current integer format. |
java.lang.Object |
getParameterValue(java.lang.String paramName,
java.util.Map params,
java.lang.Object bean)
Retrieves the value for the given parameter name. |
java.text.DateFormat |
getTimeFormat()
Gets the current time format. |
java.text.DateFormat |
getTimestampFormat()
Gets the current timestamp format. |
protected ExpressionType |
getTypeHandler(java.lang.Object object)
Gets the handler for the object's type |
ExpressionTuple |
parseExpr(char[] expression,
int offset,
int lastPos,
java.util.Map params,
java.lang.Object bean)
Parses a text, which is likely to contain expressions. |
ExpressionTuple |
parseExpr(java.lang.String expression,
java.util.Map params,
java.lang.Object bean)
Parses a text, which is likely to contain expressions. |
private int |
parseOperand(ExpressionTuple expressionTuple,
int parseState,
int position,
java.util.Map params,
java.lang.Object bean)
Parses an operand |
private int |
parseOperation(ExpressionTuple expressionTuple,
int position)
Parses an operation |
void |
registerDefaultTypeHandlers()
Registers the default type handlers. |
void |
registerTypeHandler(java.lang.Class typeClass,
ExpressionType type)
Registers an expression type |
void |
registerTypeHandler(ExpressionType type)
Registers an expression type |
private ExpressionTuple |
scanExpression(char[] expression,
int offset,
int lastPos)
Scans the given text for expressions. |
private StatementInfo |
scanForStatements(char[] text,
int firstPos,
int lastPos)
Scanning for statements: Statements do begin with '_' and end with the same character. |
void |
setFormatHelper(org.ujac.util.text.FormatHelper formatHelper)
Sets the used format helper. |
void |
setFormatTableValues(boolean formatTableValues)
Setter method for the flag formatTableValues. |
void |
unregisterAllTypeHandlers()
Unregisters all expression types |
void |
unregisterTypeHandler(java.lang.Class typeClass)
Unregisters an expression type |
void |
unregisterTypeHandler(ExpressionType type)
Unregisters an expression type |
private void |
writeOutput(java.io.Writer writer,
java.lang.String content)
Writes output to the given string writer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
PS_OBJECT
public static final int PS_OBJECT
- Constant for the parse state 'object'.
- See Also:
- Constant Field Values
PS_OPERATION
public static final int PS_OPERATION
- Constant for the parse state 'operation'.
- See Also:
- Constant Field Values
PS_OPERAND
public static final int PS_OPERAND
- Constant for the parse state 'operand'.
- See Also:
- Constant Field Values
DEFAULT_TYPE
public static final java.lang.Class DEFAULT_TYPE
- The name of the default type handler.
GETTER_ARG_TYPES
public static final java.lang.Class[] GETTER_ARG_TYPES
- The argument type list for a getter method.
GETTER_ARGS
public static final java.lang.Object[] GETTER_ARGS
- The argument list for a getter method.
formatTableValues
private boolean formatTableValues
- A flag which defines, whether BXTable fields are returned as formatted Strings,
or their defineddata types are considered for returning values.
formatHelper
private org.ujac.util.text.FormatHelper formatHelper
- The format helper to use.
typeHandlers
private java.util.Map typeHandlers
- A map holding the registered type handlers by their names.
operationPriorityMap
private static final java.util.Map operationPriorityMap
- The operation priority map.
| Constructor Detail |
ExpressionInterpreter
public ExpressionInterpreter()
- Constructs an ExpressionInterpreter instance with no specific attributes.
ExpressionInterpreter
public ExpressionInterpreter(org.ujac.util.text.FormatHelper formatHelper)
- Constructs an ExpressionInterpreter instance with no specific attributes.
| Method Detail |
getFormatHelper
public org.ujac.util.text.FormatHelper getFormatHelper()
- Gets the used format helper.
setFormatHelper
public void setFormatHelper(org.ujac.util.text.FormatHelper formatHelper)
- Sets the used format helper.
registerTypeHandler
public void registerTypeHandler(ExpressionType type)
- Registers an expression type
registerTypeHandler
public void registerTypeHandler(java.lang.Class typeClass, ExpressionType type)
- Registers an expression type
unregisterTypeHandler
public void unregisterTypeHandler(ExpressionType type)
- Unregisters an expression type
unregisterTypeHandler
public void unregisterTypeHandler(java.lang.Class typeClass)
- Unregisters an expression type
unregisterAllTypeHandlers
public void unregisterAllTypeHandlers()
- Unregisters all expression types
registerDefaultTypeHandlers
public void registerDefaultTypeHandlers()
- Registers the default type handlers. This method is called by the constructor.
getFormatTableValues
public boolean getFormatTableValues()
- Getter method for the flag formatTableValues.
setFormatTableValues
public void setFormatTableValues(boolean formatTableValues)
- Setter method for the flag formatTableValues.
getParameterValue
public java.lang.Object getParameterValue(java.lang.String paramName, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Retrieves the value for the given parameter name.
eval
public java.lang.String eval(java.lang.String text, java.util.Map params) throws ExpressionException
- Evaluates a text, which is likely to contain expressions.
eval
public void eval(java.lang.String text, java.io.Writer writer, java.util.Map params) throws ExpressionException, java.io.IOException
- Evaluates a text, which is likely to contain expressions.
eval
public java.lang.String eval(java.lang.String text, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates a text, which is likely to contain expressions.
eval
public void eval(java.lang.String text, java.io.Writer writer, java.util.Map params, java.lang.Object bean) throws ExpressionException, java.io.IOException
- Evaluates a text, which is likely to contain expressions.
eval
public void eval(char[] text,
java.io.Writer writer,
int firstPos,
int lastPos,
java.util.List tokens,
int level,
java.util.Map params,
java.lang.Object bean)
throws ExpressionException,
java.io.IOException
- Evaluates a text, which is likely to contain expressions.
writeOutput
private void writeOutput(java.io.Writer writer, java.lang.String content) throws java.io.IOException
- Writes output to the given string writer.
scanForStatements
private StatementInfo scanForStatements(char[] text, int firstPos, int lastPos) throws StatementException
- Scanning for statements:
Statements do begin with '_' and end with the same character.
Valid statements are:
- _if_{expr} ... [_else_ ... ] _endif_
- _if_{expr} ... [_elseif_ ... ] _endif_
- _if_{expr} ... [_elseif_ ... _else_] _endif_
- _foreach_{
expr} ... _endfor_ - _loop_{expr} .... _endloop_
evalStatement
private void evalStatement(StatementInfo stmtInfo, java.io.Writer writer, char[] text, int level, java.util.Map params, java.lang.Object bean) throws java.io.IOException, ExpressionException
- Evaluates the given statement.
callProcedure
private void callProcedure(ProcedureInfo procInfo, java.util.List arguments, java.io.Writer writer, int level, java.util.Map params, java.lang.Object bean) throws java.io.IOException, ExpressionException
- Calls the given procedure
cloneParams
private java.util.Map cloneParams(java.util.Map params)
- Clones the given parameter map.
getConstantValue
public java.lang.String getConstantValue(java.lang.String constant) throws ExpressionException
- Parses constant from given text.
evalBoolean
public boolean evalBoolean(java.lang.String text, java.util.Map params) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as a Boolean.
evalBoolean
public boolean evalBoolean(java.lang.String text, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as a Boolean.
evalDate
public java.util.Date evalDate(java.lang.String text, java.util.Map params) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as a Date.
evalDate
public java.util.Date evalDate(java.lang.String text, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as a Date.
evalInt
public int evalInt(java.lang.String text, java.util.Map params) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as an integer.
evalInt
public int evalInt(java.lang.String text, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as an int.
evalLong
public long evalLong(java.lang.String text, java.util.Map params) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as a long.
evalLong
public long evalLong(java.lang.String text, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as an long.
evalDouble
public double evalDouble(java.lang.String text, java.util.Map params) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as a double.
evalDouble
public double evalDouble(java.lang.String text, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as a double.
evalFloat
public float evalFloat(java.lang.String text, java.util.Map params) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as a float.
evalFloat
public float evalFloat(java.lang.String text, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as a double.
evalObject
public java.lang.Object evalObject(java.lang.String text, java.util.Map params) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as an Object.
evalObject
public java.lang.Object evalObject(java.lang.String text, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates a text, which is likely to contain expressions as an Object.
parseExpr
public ExpressionTuple parseExpr(java.lang.String expression, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Parses a text, which is likely to contain expressions.
parseExpr
public ExpressionTuple parseExpr(char[] expression, int offset, int lastPos, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Parses a text, which is likely to contain expressions.
parseOperation
private int parseOperation(ExpressionTuple expressionTuple, int position) throws ExpressionException
- Parses an operation
checkOperation
private static final Operation checkOperation(java.lang.String name)
- Chooses the priority of the given operation.
parseOperand
private int parseOperand(ExpressionTuple expressionTuple, int parseState, int position, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Parses an operand
scanExpression
private ExpressionTuple scanExpression(char[] expression, int offset, int lastPos) throws ExpressionException
- Scans the given text for expressions.
evalStringOperand
public java.lang.String evalStringOperand(Operand operand, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates an expression as a String value.
evalBooleanOperand
public boolean evalBooleanOperand(Operand operand, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates an expression as a boolean value.
evalIntOperand
public int evalIntOperand(Operand operand, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates an expression as an integer value.
evalLongOperand
public long evalLongOperand(Operand operand, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates an expression as an long value.
evalDoubleOperand
public double evalDoubleOperand(Operand operand, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates an expression as an double value.
evalFloatOperand
public float evalFloatOperand(Operand operand, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates an expression as an float value.
evalDateOperand
public java.util.Date evalDateOperand(Operand operand, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates an expression as an Date value.
evalOperand
public java.lang.Object evalOperand(Operand operand, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates an operand.
evalExpr
public java.lang.Object evalExpr(ExpressionTuple expr, java.util.Map params, java.lang.Object bean) throws ExpressionException
- Evaluates an expression.
getTypeHandler
protected ExpressionType getTypeHandler(java.lang.Object object)
- Gets the handler for the object's type
getIntegerFormat
public java.text.NumberFormat getIntegerFormat()
- Gets the current integer format.
getDoubleFormat
public java.text.NumberFormat getDoubleFormat()
- Gets the current double format.
getDateFormat
public java.text.DateFormat getDateFormat()
- Gets the current date format.
getTimeFormat
public java.text.DateFormat getTimeFormat()
- Gets the current time format.
getTimestampFormat
public java.text.DateFormat getTimestampFormat()
- Gets the current timestamp format.
|
|||||||||
| Home >> All >> org >> ujac >> util >> [ exi overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.ujac.util.exi.ExpressionInterpreter