com.jaxfront.core.rule
Class AbstractAction

java.lang.Object
  extended by com.jaxfront.core.rule.AbstractAction
All Implemented Interfaces:
IAction, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
JavaAction, ModelAction, UIAction

public abstract class AbstractAction
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable, IAction

Defines an abstract action. Every action implements a perform method on different target types/visualizers. An action gets fired after an E-C-A rules has been validated true.

See Also:
Rule, Serialized Form

Field Summary
 
Fields inherited from interface com.jaxfront.core.rule.IAction
TYPE_ABSTRACT, TYPE_FORMULA, TYPE_JAVA, TYPE_MODEL, TYPE_UI
 
Constructor Summary
AbstractAction(Document DOM, Type sourceType, Type xuiType, java.lang.String xpath, java.lang.String className)
          Creates an action based on a document, a source type and an xpath.
 
Method Summary
abstract  void check(Document dom, Type target)
           
static Action checkAction(java.lang.ClassLoader classloader, java.lang.String className)
           
 java.lang.Object clone(Type newSource)
           
 boolean fireChange()
           
 int getActionType()
           
 Document getDOM()
           
 FormulaExpression getExpression()
           
 AbstractAction getInverseAction()
          Returns the definde inverse action.
 Type getSource()
           
 java.util.List getTargetTypes()
          Returns the target types of this action.
 java.lang.String getTargetXPath()
           
 Action getUserAction()
          Returns the user defined action.
 boolean isEmpty()
           
 boolean isInversable()
          Indicates if an action is able to invoke inverse.
 boolean isUsingUserAction()
           
 void perform(Type eventSource)
          Performs any kind of action command.
 void perform(Type eventSource, boolean isTemporary)
          Performs an action on all target types.
 void perform(Type eventSource, boolean isTemporary, java.util.Stack callStack)
           
 void performInverse(Type eventSource, java.util.Stack callStack)
           
 void release()
           
 void setFireChange(boolean fireChange)
           
 void setInverseAction(AbstractAction action)
          Sets an inverse action.
 void setSource(Type sourceType)
           
 void setTargetXPath(java.lang.String xpath)
           
 void setUseActionTargetAsBase(boolean use)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractAction

public AbstractAction(Document DOM,
                      Type sourceType,
                      Type xuiType,
                      java.lang.String xpath,
                      java.lang.String className)
Creates an action based on a document, a source type and an xpath.

Parameters:
DOM - JAXFront document
sourceType - the source type of this action
xpath - the target xpath
Method Detail

check

public abstract void check(Document dom,
                           Type target)
                    throws RuleInvocationException
Throws:
RuleInvocationException

checkAction

public static Action checkAction(java.lang.ClassLoader classloader,
                                 java.lang.String className)
                          throws java.lang.ClassNotFoundException,
                                 java.lang.InstantiationException,
                                 java.lang.IllegalAccessException
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

clone

public java.lang.Object clone(Type newSource)

fireChange

public boolean fireChange()

getActionType

public int getActionType()
Specified by:
getActionType in interface IAction
Returns:
the action type 0 = Abstract Action, 1 = ModelAction, 2 = Formula Action ,3 = UI Action, 4 = Java Action ;

getDOM

public Document getDOM()

getExpression

public FormulaExpression getExpression()
Specified by:
getExpression in interface IAction
Returns:
formula expression if exist, null otherwise. Needed to evaluate referenced nodes

getInverseAction

public AbstractAction getInverseAction()
Description copied from interface: IAction
Returns the definde inverse action.

Specified by:
getInverseAction in interface IAction

getSource

public Type getSource()
Specified by:
getSource in interface IAction

getTargetTypes

public java.util.List getTargetTypes()
Returns the target types of this action.


getTargetXPath

public java.lang.String getTargetXPath()

getUserAction

public Action getUserAction()
Returns the user defined action.

Returns:
the user defined action

isEmpty

public boolean isEmpty()

isInversable

public boolean isInversable()
Indicates if an action is able to invoke inverse.


isUsingUserAction

public boolean isUsingUserAction()

perform

public void perform(Type eventSource)
             throws RuleInvocationException
Description copied from interface: IAction
Performs any kind of action command.

Specified by:
perform in interface IAction
Throws:
RuleInvocationException

perform

public void perform(Type eventSource,
                    boolean isTemporary)
             throws RuleInvocationException
Description copied from interface: IAction
Performs an action on all target types.

Specified by:
perform in interface IAction
isTemporary - saying if this action is not completed yet
Throws:
RuleInvocationException

perform

public void perform(Type eventSource,
                    boolean isTemporary,
                    java.util.Stack callStack)
             throws RuleInvocationException
Specified by:
perform in interface IAction
Throws:
RuleInvocationException

performInverse

public void performInverse(Type eventSource,
                           java.util.Stack callStack)
                    throws RuleInvocationException
Specified by:
performInverse in interface IAction
Throws:
RuleInvocationException

release

public void release()
Specified by:
release in interface IAction

setFireChange

public void setFireChange(boolean fireChange)

setInverseAction

public void setInverseAction(AbstractAction action)
Sets an inverse action.

Parameters:
action - inverse action

setSource

public void setSource(Type sourceType)
Specified by:
setSource in interface IAction

setTargetXPath

public void setTargetXPath(java.lang.String xpath)

setUseActionTargetAsBase

public void setUseActionTargetAsBase(boolean use)

toString

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