com.jaxfront.core.rule
Class ConditionExpression

java.lang.Object
  extended by com.jaxfront.core.rule.AbstractCondition
      extended by com.jaxfront.core.rule.ConditionExpression
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ConditionExpression
extends AbstractCondition
implements java.io.Serializable, java.lang.Cloneable

Default implementation of the condition interface. This condition evaluates a formula expression to figure out if it is true. A condition class name may be provided for additional condition checks. This class has to implement the Condition interface.

See Also:
FormulaExpression, Serialized Form

Constructor Summary
ConditionExpression(int id, Document DOM, Type source, Type xuiCondition)
          Creates a condition expression based on a document, a source type and a xuiCondition which defines a formula expression.
 
Method Summary
 java.lang.Object clone(Type newSourceType)
           
 boolean doesConcern(Type sourceType, boolean inclTargets)
          Returns true if any change in the submitted sourceType concerns this condition.
 FormulaExpression getFormulaExpression()
           
static java.lang.Class initUserClass(java.lang.ClassLoader classloader, java.lang.String className)
          Initializes a user condition and returns a class instance if it is valid.
 boolean isTrue(Type source, java.lang.Object event)
          A formulaExpression gets evaluated followed by user defined condition class (if available).
 boolean isUsingUserClass()
          Indicates if an additional valid user condition class exists.
static ConditionExpression NO_CONDITION()
           
 void release()
          Releases all allocated resources of this condition.
 java.lang.String toString()
           
 
Methods inherited from class com.jaxfront.core.rule.AbstractCondition
getMessage, getSource, isShowingError, isUsingDefaultToggle, setSource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConditionExpression

public ConditionExpression(int id,
                           Document DOM,
                           Type source,
                           Type xuiCondition)
Creates a condition expression based on a document, a source type and a xuiCondition which defines a formula expression.

Parameters:
DOM - target document
source - holder of this condition
xuiCondition - xui definition holding a formulaExpression
Method Detail

clone

public java.lang.Object clone(Type newSourceType)

doesConcern

public boolean doesConcern(Type sourceType,
                           boolean inclTargets)
Returns true if any change in the submitted sourceType concerns this condition.

Parameters:
sourceType - type which may concern this condition

getFormulaExpression

public FormulaExpression getFormulaExpression()

initUserClass

public static java.lang.Class initUserClass(java.lang.ClassLoader classloader,
                                            java.lang.String className)
Initializes a user condition and returns a class instance if it is valid.

Parameters:
className - representing an implementation class for the condition interface

isTrue

public boolean isTrue(Type source,
                      java.lang.Object event)
               throws FormulaException
A formulaExpression gets evaluated followed by user defined condition class (if available). Returns true if both evaluate true.

Parameters:
event - TODO
Throws:
FormulaException

isUsingUserClass

public boolean isUsingUserClass()
Indicates if an additional valid user condition class exists.


NO_CONDITION

public static ConditionExpression NO_CONDITION()

release

public void release()
Releases all allocated resources of this condition.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object