|
|||||||||
| 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 Form| Field Summary | |
|---|---|
static java.lang.String |
TRUE
|
| Constructor Summary | |
|---|---|
FormulaExpression()
|
|
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(Type source,
java.lang.String expression,
boolean includeOnlySerializable,
boolean registerFormula,
java.lang.String id)
FormulaExpression constructor. |
|
FormulaExpression(Type source,
java.lang.String expression,
java.lang.String id)
|
|
FormulaExpression(Type source,
java.lang.String expression,
TableCell cell,
boolean registerFormula)
FormulaExpression constructor. |
|
| Method Summary | |
|---|---|
void |
checkSyntax()
|
boolean |
doesConcern(Type sourceType,
boolean checkTargets)
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(boolean forceEval)
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.String |
evaluate(Type target,
java.lang.Object eventSource,
java.lang.Object event,
boolean forceEval,
java.util.List<Type> targetTypes)
|
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.lang.String |
getID()
|
long |
getLastUpdateTS()
|
java.util.Vector |
getReferencedExpressionNodes()
|
java.lang.Class |
getResultClassForSort()
|
Type |
getSource()
Returns the holder of this expression. |
TableCell |
getTableCell()
|
int |
hashCode()
|
boolean |
isCachable()
|
boolean |
isDirty()
|
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)
|
boolean |
isTrue(Type source,
java.lang.Object event,
boolean useEventSourceAsBase,
boolean forceEval)
Evaluate the formula, expecting a boolean as return value e.g. count( . |
boolean |
needsUpdate()
|
void |
release()
Releases all allocated resources for this formulaExpression. |
void |
setCachable(boolean isCachable)
|
void |
setCachedResult(java.lang.Object cachedResult)
|
void |
setDoesIncludeOnlySerializableNodes(boolean doesInclude)
|
void |
setExpression(java.lang.String expression)
Sets an expression string |
void |
setReferencedExpressionNodes(java.util.Vector expressionNodes)
|
void |
setSource(Type newSource)
Sets the holder of this expression. |
void |
setTableCell(TableCell cell)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TRUE
| Constructor Detail |
|---|
public FormulaExpression()
public FormulaExpression(Type source,
java.lang.String expression)
source - The source Type to apply expression onexpression - the formula expression
public 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 functions
public FormulaExpression(Type source,
java.lang.String expression,
boolean includeOnlySerializable,
boolean registerFormula)
public FormulaExpression(Type source,
java.lang.String expression,
boolean includeOnlySerializable,
boolean registerFormula,
java.lang.String id)
source - The source Type to apply expression onexpression - the formula expressionincludeNoneSerializable - indicates if none serializable nodes are includes in the nodes functions
public FormulaExpression(Type source,
java.lang.String expression,
java.lang.String id)
public FormulaExpression(Type source,
java.lang.String expression,
TableCell cell,
boolean registerFormula)
source - The source Type to apply expression onexpression - the formula expression| Method Detail |
|---|
public void checkSyntax()
throws org.nfunk.jep.ParseException
org.nfunk.jep.ParseException
public boolean doesConcern(Type sourceType,
boolean checkTargets)
sourceType - type which may concern this conditionpublic boolean doesIncludeOnlySerializableNodes()
public void domChanged(DOMChangeEvent event)
DOMChangeListener
domChanged in interface DOMChangeListenerevent - occured DOMChangeEventpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object
public java.lang.String evaluate()
throws FormulaException
FormulaException
public java.lang.String evaluate(boolean forceEval)
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.String evaluate(Type target,
java.lang.Object eventSource,
java.lang.Object event,
boolean forceEval,
java.util.List<Type> targetTypes)
throws FormulaException
FormulaException
public java.lang.Object evaluateObject()
throws FormulaException
FormulaException
public java.lang.Object evaluateObject(Type target)
throws FormulaException
FormulaExceptionpublic java.lang.Object getCachedResult()
FormulaExceptionpublic java.lang.String getErrorInfo()
isPreProcessable - indicates if this expression is preprocessablepublic java.lang.String getExpression()
public java.lang.String getID()
public long getLastUpdateTS()
public java.util.Vector getReferencedExpressionNodes()
public java.lang.Class getResultClassForSort()
public Type getSource()
public TableCell getTableCell()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean isCachable()
public boolean isDirty()
public boolean isReleased()
public boolean isTrue(Type sourceType)
throws FormulaException
sourceType - source type to evaluate expression on
thrown - if the expression could not be parsed
FormulaException
public boolean isTrue(Type source,
java.lang.Object event,
boolean useEventSourceAsBase)
throws FormulaException
FormulaException
public boolean isTrue(Type source,
java.lang.Object event,
boolean useEventSourceAsBase,
boolean forceEval)
throws FormulaException
event - TODO
thrown - if the expression could not be parsed
FormulaExceptionpublic boolean needsUpdate()
public void release()
public void setCachable(boolean isCachable)
public void setCachedResult(java.lang.Object cachedResult)
_cachedResult - The _cachedResult to set.public void setDoesIncludeOnlySerializableNodes(boolean doesInclude)
public void setExpression(java.lang.String expression)
expression - public void setReferencedExpressionNodes(java.util.Vector expressionNodes)
public void setSource(Type newSource)
public void setTableCell(TableCell cell)
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||