|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jaxfront.core.rule.FormulaExpression
public class FormulaExpression
The FormulaExpression encapsulates a JAXFront formula defined in the xui definition. A FormulaExpression consists of a expression defined in the xui, an sourceType the formula will run against of and some variables defined in xui too. For performance reasons a formula can be marked as preprocessable, this means if a formula has a static content it's not necesarry to calculate it again and again. In this case simly the result is returned without any processing effort. With the update method it's possible to tell the formula to set the internal state from preprossed to not preprossed!
MathEvaluator
,
Variable
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
TRUE
|
Constructor Summary | |
---|---|
FormulaExpression(Type source,
java.lang.String expression)
FormulaExpression constructor. |
|
FormulaExpression(Type source,
java.lang.String expression,
boolean includeOnlySerializable)
FormulaExpression constructor. |
|
FormulaExpression(Type source,
java.lang.String expression,
boolean includeOnlySerializable,
boolean registerFormula)
FormulaExpression constructor. |
|
FormulaExpression(Type source,
java.lang.String expression,
TableCell cell)
FormulaExpression constructor. |
Method Summary | |
---|---|
void |
checkSyntax()
|
boolean |
doesConcern(Type sourceType)
Returns true if any change in the submitted sourceType concerns a defined variable result. |
boolean |
doesIncludeOnlySerializableNodes()
|
void |
domChanged(DOMChangeEvent event)
Respond method for a DOM state changed (DOMChangeEvent). |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
evaluate()
Evaluate the formula by doing a XPath eval() operation. |
java.lang.String |
evaluate(Type target,
java.lang.Object eventSource,
java.lang.Object event)
Evaluate the formula by doing a XPath eval() operation. |
java.lang.Object |
evaluateObject()
|
java.lang.Object |
evaluateObject(Type target)
|
java.lang.Object |
getCachedResult()
|
java.lang.String |
getErrorInfo()
Sets the ability to be preprocessable |
java.lang.String |
getExpression()
Returns the expression string. |
java.util.Vector |
getReferencedExpressionNodes()
|
java.lang.Class |
getResultClassForSort()
|
Type |
getSource()
Returns the holder of this expression. |
TableCell |
getTableCell()
|
int |
hashCode()
|
boolean |
isReleased()
|
boolean |
isTrue(Type sourceType)
Evaluate the formula based on a source type, expecting a boolean as return value e.g. count( . |
boolean |
isTrue(Type source,
java.lang.Object event,
boolean useEventSourceAsBase)
Evaluate the formula, expecting a boolean as return value e.g. count( . |
static FormulaExpression |
lookup(Type source,
java.lang.String expression)
|
static FormulaExpression |
lookup(Type source,
java.lang.String expression,
boolean includeOnlySerializable)
|
void |
release()
Releases all allocated resources for this formulaExpression. |
void |
setCachedResult(java.lang.Object cachedResult)
|
void |
setDoesIncludeOnlySerializableNodes(boolean doesInclude)
|
void |
setExpression(java.lang.String expression)
Sets an expression string |
void |
setSource(Type newSource)
Sets the holder of this expression. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TRUE
Constructor Detail |
---|
public FormulaExpression(Type source, java.lang.String expression)
source
- The source Type to apply expression onexpression
- the formula expressionpublic FormulaExpression(Type source, java.lang.String expression, TableCell cell)
source
- The source Type to apply expression onexpression
- the formula expressionpublic FormulaExpression(Type source, java.lang.String expression, boolean includeOnlySerializable)
source
- The source Type to apply expression onexpression
- the formula expressionincludeNoneSerializable
- indicates if none serializable nodes are includes
in the nodes functionspublic FormulaExpression(Type source, java.lang.String expression, boolean includeOnlySerializable, boolean registerFormula)
source
- The source Type to apply expression onexpression
- the formula expressionincludeNoneSerializable
- indicates if none serializable nodes are includes
in the nodes functionsMethod Detail |
---|
public java.lang.String evaluate() throws FormulaException
FormulaException
public java.lang.String evaluate(Type target, java.lang.Object eventSource, java.lang.Object event) throws FormulaException
eventSource
- TODOevent
- TODO
FormulaException
public java.lang.Object evaluateObject() throws FormulaException
FormulaException
public java.lang.Object evaluateObject(Type target) throws FormulaException
FormulaException
public Type getSource()
public void setSource(Type newSource)
public boolean isTrue(Type source, java.lang.Object event, boolean useEventSourceAsBase) throws FormulaException
event
- TODO
thrown
- if the expression could not be parsed
FormulaException
public boolean isTrue(Type sourceType) throws FormulaException
sourceType
- source type to evaluate expression on
thrown
- if the expression could not be parsed
FormulaException
public java.lang.String getErrorInfo()
isPreProcessable
- indicates if this expression is preprocessablepublic boolean doesConcern(Type sourceType)
sourceType
- type which may concern this conditionpublic void checkSyntax() throws org.nfunk.jep.ParseException
org.nfunk.jep.ParseException
public java.util.Vector getReferencedExpressionNodes()
public void release()
public boolean isReleased()
public void setExpression(java.lang.String expression)
expression
- public java.lang.String getExpression()
public void setCachedResult(java.lang.Object cachedResult)
_cachedResult
- The _cachedResult to set.public java.lang.Object getCachedResult()
FormulaException
public java.lang.Class getResultClassForSort()
public void domChanged(DOMChangeEvent event)
DOMChangeListener
domChanged
in interface DOMChangeListener
event
- occured DOMChangeEventpublic boolean doesIncludeOnlySerializableNodes()
public void setDoesIncludeOnlySerializableNodes(boolean doesInclude)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static FormulaExpression lookup(Type source, java.lang.String expression)
public static FormulaExpression lookup(Type source, java.lang.String expression, boolean includeOnlySerializable)
public TableCell getTableCell()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |