java.lang.Object | |
↳ | webwork.util.SimpleTest |
This class is used to handle test expressions in an efficient way. It is more than 5 times faster than the javacc generated Parser.java Instances of the class are retrieved through the static method getSimpleTest. If the method returns null it means the expression was too complex for this class too handle. Complex expressions are those using parenthesis to control the order of evaluation. Those expressions will instead be handled by the old javacc Parser.java class.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | AND | ||||||||||
char | AND_CHAR | ||||||||||
int | CHECK_NULL | ||||||||||
int | EQUAL | ||||||||||
char | EQUAL_CHAR | ||||||||||
int | GREATER | ||||||||||
char | GREATER_CHAR | ||||||||||
int | GREATER_EQUAL | ||||||||||
int | LESS | ||||||||||
char | LESS_CHAR | ||||||||||
int | LESS_EQUAL | ||||||||||
int | NONE | ||||||||||
char | NOT_CHAR | ||||||||||
int | NOT_EQUAL | ||||||||||
int | OR | ||||||||||
char | OR_CHAR | ||||||||||
char | QUOTE_CHAR |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
condition | |||||||||||
exp1 | |||||||||||
exp2 | |||||||||||
neg1 | |||||||||||
neg2 | |||||||||||
nextTest | |||||||||||
operator | |||||||||||
q1 | |||||||||||
q2 | |||||||||||
sameVal1 | |||||||||||
sameVal2 | |||||||||||
value1 | |||||||||||
value2 |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a SimpleTest for the expression exp, and make use of the values found in the previously evaluated
expression prevText if possible
| |||||||||||
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get a SimpleTest object for the expression.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Look through the expression to find any operators like && or ||, etc.
| |||||||||||
This method checks if the expression is a constant value.
| |||||||||||
determine true or false by comparing the comparison result with the operator.
| |||||||||||
The values in prevVal1 and prevVal2 will always be sent in.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a SimpleTest for the expression exp, and make use of the values found in the previously evaluated expression prevText if possible
ComplexException |
---|
Get a SimpleTest object for the expression. If the expression is too complex then null is returned If the expression has been handled before then a cached SimpleTest object is returned. Otherwise a new one is created
Look through the expression to find any operators like && or ||, etc. If found then the operator variable is updated.
ComplexException |
---|
This method checks if the expression is a constant value. If it is not a constant then the method returns the object NO_CONSTANT If it is a constant then it returns the constant value which may be null
determine true or false by comparing the comparison result with the operator.
comp | the comparison result |
---|---|
condition | the condition |
The values in prevVal1 and prevVal2 will always be sent in. They can be null because they are not used or because the value found was null. This does not matter. The expression after this one will only care about the value IF the same expression existed in this test as in the next test.