org.apache.commons.scxml.model
Class SCXML

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

public class SCXML
extends Object
implements Serializable, NamespacePrefixesHolder

The class in this SCXML object model that corresponds to the <scxml> root element, and serves as the "document root".

See Also:
Serialized Form

Field Summary
static String XMLNS
          The SCXML XMLNS.
 
Constructor Summary
SCXML()
          Constructor.
 
Method Summary
 void addChild(TransitionTarget tt)
          Add an immediate child target of the SCXML root.
 void addState(State state)
          Deprecated. Use addChild(TransitionTarget) instead.
 void addTarget(TransitionTarget target)
          Add a target to this SCXML document.
 Map getChildren()
          Get the immediate child targets of the SCXML root.
 Datamodel getDatamodel()
          Get the data model placed at document root.
 String getInitial()
          Get the ID of the initial transition target.
 String getInitialstate()
          Deprecated. Use getInitial() instead.
 State getInitialState()
          Deprecated. Use getInitialTarget() instead. Returns null if the initial target is a Parallel.
 TransitionTarget getInitialTarget()
          Get the initial TransitionTarget.
 Map getNamespaces()
          Get the namespace definitions specified on the SCXML element.
 Map getStates()
          Deprecated. Use getChildren() instead.
 Map getTargets()
          Get the targets map, which is a Map of all States and Parallels associated with this state machine, keyed by their id.
 String getVersion()
          Get the SCXML document version.
 String getXmlns()
          Get the xmlns of this SCXML document.
 boolean isLegacy()
          Deprecated. Will be removed in v1.0
 void setDatamodel(Datamodel datamodel)
          Set the data model at document root.
 void setInitial(String initial)
          Set the ID of the initial transition target.
 void setInitialState(State initialState)
          Deprecated. Use setInitialTarget(TransitionTarget) instead.
 void setInitialstate(String initialstate)
          Deprecated. Use setInitial(String) instead.
 void setInitialTarget(TransitionTarget initialTarget)
          Set the initial TransitionTarget.
 void setLegacy(boolean legacy)
          Deprecated. Will be removed in v1.0
 void setNamespaces(Map namespaces)
          Set the namespace definitions specified on the SCXML element.
 void setVersion(String version)
          Set the SCXML document version.
 void setXmlns(String xmlns)
          Set the xmlns of this SCXML document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLNS

public static final String XMLNS
The SCXML XMLNS.

See Also:
Constant Field Values
Constructor Detail

SCXML

public SCXML()
Constructor.

Method Detail

getInitialState

public final State getInitialState()
Deprecated. Use getInitialTarget() instead. Returns null if the initial target is a Parallel.

Get the initial State.

Returns:
State Returns the initialstate.

setInitialState

public final void setInitialState(State initialState)
Deprecated. Use setInitialTarget(TransitionTarget) instead.

Set the initial State.

Parameters:
initialState - The initialstate to set.

getInitialTarget

public final TransitionTarget getInitialTarget()
Get the initial TransitionTarget.

Returns:
Returns the initial target for this state machine.
Since:
0.7

setInitialTarget

public final void setInitialTarget(TransitionTarget initialTarget)
Set the initial TransitionTarget.

Parameters:
initialTarget - The initial target to set.
Since:
0.7

getDatamodel

public final Datamodel getDatamodel()
Get the data model placed at document root.

Returns:
Returns the data model.

setDatamodel

public final void setDatamodel(Datamodel datamodel)
Set the data model at document root.

Parameters:
datamodel - The Datamodel to set.

getStates

public final Map getStates()
Deprecated. Use getChildren() instead.

Get the children states.

Returns:
Map Returns map of the child states.

addState

public final void addState(State state)
Deprecated. Use addChild(TransitionTarget) instead.

Add a child state.

Parameters:
state - The state to be added to the states Map.

getChildren

public final Map getChildren()
Get the immediate child targets of the SCXML root.

Returns:
Map Returns map of the child targets.
Since:
0.7

addChild

public final void addChild(TransitionTarget tt)
Add an immediate child target of the SCXML root.

Parameters:
tt - The transition target to be added to the states Map.
Since:
0.7

getTargets

public final Map getTargets()
Get the targets map, which is a Map of all States and Parallels associated with this state machine, keyed by their id.

Returns:
Map Returns the targets.

addTarget

public final void addTarget(TransitionTarget target)
Add a target to this SCXML document.

Parameters:
target - The target to be added to the targets Map.

getVersion

public final String getVersion()
Get the SCXML document version.

Returns:
Returns the version.

setVersion

public final void setVersion(String version)
Set the SCXML document version.

Parameters:
version - The version to set.

getXmlns

public final String getXmlns()
Get the xmlns of this SCXML document.

Returns:
Returns the xmlns.

setXmlns

public final void setXmlns(String xmlns)
Set the xmlns of this SCXML document.

Parameters:
xmlns - The xmlns to set.

getNamespaces

public final Map getNamespaces()
Get the namespace definitions specified on the SCXML element. May be null.

Specified by:
getNamespaces in interface NamespacePrefixesHolder
Returns:
The namespace definitions specified on the SCXML element, may be null.

setNamespaces

public final void setNamespaces(Map namespaces)
Set the namespace definitions specified on the SCXML element.

Specified by:
setNamespaces in interface NamespacePrefixesHolder
Parameters:
namespaces - The namespace definitions specified on the SCXML element.

getInitialstate

public final String getInitialstate()
Deprecated. Use getInitial() instead.

Get the ID of the initial state.

Returns:
String Returns the initial state ID (used by XML Digester only).
See Also:
getInitialTarget()

setInitialstate

public final void setInitialstate(String initialstate)
Deprecated. Use setInitial(String) instead.

Set the ID of the initial state.

Parameters:
initialstate - The initial state ID (used by XML Digester only).
See Also:
setInitialTarget(TransitionTarget)

getInitial

public final String getInitial()
Get the ID of the initial transition target.

Returns:
String Returns the initial transition target ID (used by XML Digester only).
See Also:
getInitialTarget()

setInitial

public final void setInitial(String initial)
Set the ID of the initial transition target.

Parameters:
initial - The initial transition target ID (used by XML Digester only).
See Also:
setInitialTarget(TransitionTarget)

isLegacy

public final boolean isLegacy()
Deprecated. Will be removed in v1.0

Whether the legacy parser was used.

Returns:
True, if legacy parser was used.
Since:
0.9

setLegacy

public final void setLegacy(boolean legacy)
Deprecated. Will be removed in v1.0

Set whether the legacy parser was used.

Parameters:
legacy - True, if legacy parser was used.
Since:
0.9


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