org.apache.commons.scxml.model
Class Transition

java.lang.Object
  extended by org.apache.commons.scxml.model.Executable
      extended by org.apache.commons.scxml.model.Transition
All Implemented Interfaces:
Serializable, NamespacePrefixesHolder

public class Transition
extends Executable
implements NamespacePrefixesHolder

The class in this SCXML object model that corresponds to the <transition> SCXML element. Transition rules are triggered by "events" and conditionalized via "guard-conditions".

See Also:
Serialized Form

Constructor Summary
Transition()
          Constructor.
 
Method Summary
 String getCond()
          Get the guard condition (may be null).
 String getEvent()
          Get the event that will trigger this transition (pending evaluation of the guard condition in favor).
 Map getNamespaces()
          Get the XML namespaces at this action node in the SCXML document.
 String getNext()
          Get the ID of the transition target (may be null, if, for example, the target is specified inline).
 Path getPath()
          Deprecated. Use getPaths() instead.
 List getPaths()
          Get the path(s) of this transiton.
 TransitionTarget getRuntimeTarget()
          Deprecated. A transition may have multiple targets, use getRuntimeTargets() instead.
 List getRuntimeTargets()
          Get the list of runtime transition target, which always contains atleast one TransitionTarget instance.
 TransitionTarget getTarget()
          Deprecated. A transition may have multiple targets, use getTargets() instead.
 List getTargets()
          Get the list of transition targets (may be an empty list).
 void setCond(String cond)
          Set the guard condition.
 void setEvent(String event)
          Set the event that will trigger this transition (pending evaluation of the guard condition in favor).
 void setNamespaces(Map namespaces)
          Set the XML namespaces at this action node in the SCXML document.
 void setNext(String next)
          Set the transition target by specifying its ID.
 void setTarget(TransitionTarget target)
          Deprecated. Use setTargets(List) instead.
 
Methods inherited from class org.apache.commons.scxml.model.Executable
addAction, getActions, getParent, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Transition

public Transition()
Constructor.

Method Detail

getCond

public final String getCond()
Get the guard condition (may be null).

Returns:
Returns the cond.

setCond

public final void setCond(String cond)
Set the guard condition.

Parameters:
cond - The cond to set.

getEvent

public final String getEvent()
Get the event that will trigger this transition (pending evaluation of the guard condition in favor).

Returns:
Returns the event.

setEvent

public final void setEvent(String event)
Set the event that will trigger this transition (pending evaluation of the guard condition in favor).

Parameters:
event - The event to set.

getNamespaces

public final Map getNamespaces()
Get the XML namespaces at this action node in the SCXML document.

Specified by:
getNamespaces in interface NamespacePrefixesHolder
Returns:
Returns the map of namespaces.

setNamespaces

public final void setNamespaces(Map namespaces)
Set the XML namespaces at this action node in the SCXML document.

Specified by:
setNamespaces in interface NamespacePrefixesHolder
Parameters:
namespaces - The document namespaces.

getTarget

public final TransitionTarget getTarget()
Deprecated. A transition may have multiple targets, use getTargets() instead.

Get the transition target (may be null).

Returns:
Returns the target as specified in SCXML markup.

Remarks: Is null for "stay" transitions. Returns parent (the source node) for "self" transitions.


getTargets

public final List getTargets()
Get the list of transition targets (may be an empty list).

Returns:
Returns the target(s) as specified in SCXML markup.

Remarks: Is empty for "stay" transitions. Contains parent (the source node) for "self" transitions.

Since:
0.7

getRuntimeTarget

public final TransitionTarget getRuntimeTarget()
Deprecated. A transition may have multiple targets, use getRuntimeTargets() instead.

Get the runtime transition target, which always resolves to a TransitionTarget instance.

Returns:
Returns the actual target of a transition at runtime.

Remarks: For both the "stay" and "self" transitions it returns parent (the source node). This method should never return null.


getRuntimeTargets

public final List getRuntimeTargets()
Get the list of runtime transition target, which always contains atleast one TransitionTarget instance.

Returns:
Returns the actual targets of a transition at runtime.

Remarks: For both the "stay" and "self" transitions it returns parent (the source node). This method should never return an empty list or null.

Since:
0.7

setTarget

public final void setTarget(TransitionTarget target)
Deprecated. Use setTargets(List) instead.

Set the transition target.

Parameters:
target - The target to set.

getNext

public final String getNext()
Get the ID of the transition target (may be null, if, for example, the target is specified inline).

Returns:
String Returns the transition target ID (used by SCXML Digester only).
See Also:
getTargets()

setNext

public final void setNext(String next)
Set the transition target by specifying its ID.

Parameters:
next - The the transition target ID (used by SCXML Digester only).

getPath

public final Path getPath()
Deprecated. Use getPaths() instead.

Get the path of this transiton.

Returns:
Path returns the transition path
See Also:
Path

getPaths

public final List getPaths()
Get the path(s) of this transiton.

Returns:
List returns the list of transition path(s)
Since:
0.7
See Also:
Path


Copyright © 2005-2008 The Apache Software Foundation. All Rights Reserved.