it.amattioli.workstate.core
Class MetaRealState

Show UML class diagram
java.lang.Object
  extended by it.amattioli.workstate.core.MetaState
      extended by it.amattioli.workstate.core.MetaRealState
All Implemented Interfaces:
Receiver
Direct Known Subclasses:
MetaCompositeState, MetaReferenceState, MetaSimpleState

public abstract class MetaRealState
extends MetaState

A MetaRealState is the configuration of a RealState, a state in which a Machine can remain indefinitely. A real state must have an identifier (called tag) and may have:


Constructor Summary
MetaRealState(String tag, StateAction entry, StateAction exit)
          Build a new MetaRealState given its tag and its entry and exit action.
 
Method Summary
 void addAttribute(MetaAttribute newAttribute)
          Add an attribute definition to this MetaState.
 void checkAttribute(String attributeName, Object attributeValue)
           
 boolean equals(Object o)
          Two MetaStates are equals if they have the same class and the same tag.
 StateAction getEntryAction()
           
 StateAction getExitAction()
           
 String getTag()
           
 Map<String,Object> initialAttributesValues()
           
 boolean isAllowedAttribute(String attributeName)
          Check if this MetaState has a parameter.
 String toString()
           
 
Methods inherited from class it.amattioli.workstate.core.MetaState
addAvailableEvents, addTransition, checkParentState, descendFrom, findTriggeredTransition, getAvailableEvents, getConfig, getParent, newState, setParent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.amattioli.workstate.info.Receiver
receive
 

Constructor Detail

MetaRealState

public MetaRealState(String tag,
                     StateAction entry,
                     StateAction exit)
Build a new MetaRealState given its tag and its entry and exit action. The tag cannot be null or an empty string.

Parameters:
tag - this state identifier
entry - the state entry action or null if no action must be executed when the state is entered
exit - the state exit action or null if no action must be executed when the state is exited
Throws:
NullPointerException - if the tag is null
IllegalArgumentException - if the tag is an empty string
Method Detail

getTag

public String getTag()

getEntryAction

public StateAction getEntryAction()

getExitAction

public StateAction getExitAction()

addAttribute

public void addAttribute(MetaAttribute newAttribute)
Add an attribute definition to this MetaState.

Parameters:
newAttribute - the new attribute definition
Throws:
NullPointerException - if the newAttribute parameter is null
IllegalArgumentException - if an attribute with the same tag already exists

isAllowedAttribute

public boolean isAllowedAttribute(String attributeName)
Check if this MetaState has a parameter.

Parameters:
attributeName - the parameter tag
Returns:
true if this MetaState has a parameter with the given tag

checkAttribute

public void checkAttribute(String attributeName,
                           Object attributeValue)
                    throws WorkflowException
Throws:
WorkflowException

initialAttributesValues

public Map<String,Object> initialAttributesValues()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Two MetaStates are equals if they have the same class and the same tag.

Overrides:
equals in class Object


Copyright © 2011. All Rights Reserved.