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.

Version:
1.60
See Also:
Rule, Serialized Form

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.String className)
           
 java.lang.Object clone(Type newSource)
           
 Document getDOM()
           
 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 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

getInverseAction

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

Specified by:
getInverseAction in interface IAction

getTargetTypes

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


isInversable

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


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

isUsingUserAction

public boolean isUsingUserAction()

getUserAction

public Action getUserAction()
Returns the user defined action.

Returns:
the user defined action

checkAction

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

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

setInverseAction

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

Parameters:
action - inverse action

toString

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

clone

public java.lang.Object clone(Type newSource)

isEmpty

public boolean isEmpty()

getTargetXPath

public java.lang.String getTargetXPath()

setTargetXPath

public void setTargetXPath(java.lang.String xpath)

check

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

getDOM

public Document getDOM()

setSource

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

getSource

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

setUseActionTargetAsBase

public void setUseActionTargetAsBase(boolean use)