com.bankframe.fe.statemachine.ext.apploaders.sax
Class State

java.lang.Object
  extended bycom.bankframe.fe.statemachine.ext.apploaders.sax.State
All Implemented Interfaces:
IProcessUser, IState, IState

public class State
extends java.lang.Object
implements IState

This State class is used by the saxapploader to represent a State in the application. The loader will create an instance of this class and add it to the application as it finds State elements in the xml document.

Author:
engineering

Constructor Summary
State(org.xml.sax.Attributes atts, Application application)
          This constructor creates a new State, the State is initialised with the attribute set given.
 
Method Summary
 boolean acceptsEvent(IEvent event)
          This method is currently not implemented and returns true;
 boolean acceptsSession(IUserSession session)
          Returns true if the user session passed in can be in this state.
 void addEvent(Event event)
          This method adds an event to this state if the event indicates that it is a default event then the given event becomes the default event for this state.
 void addInputDefinition(IInputDefinition inputDefinition)
           
 boolean equals(java.lang.Object obj)
          This method returns state Id
 void executeStateCommand(IStateCommand command, boolean recurse)
          This method executes the given command on this state and (optionally) all child states.
 java.util.Iterator getChildren()
           
 IEvent getDefaultEvent()
          This method returns the default event for this state.
 IEvent getEvent(java.lang.String name)
          This method returns the event with the given name.
 java.util.Iterator getEvents()
          This method returns an Iterator of Event objects for this state.
 IState getExceptionState(java.lang.String exceptionDescription)
          Returns a State which can be used if the named exception occurs.
 java.lang.String getId()
          This method retruns the name of this State.
 IInputRequirements getInputRequirements()
           
 java.lang.String getJSPName()
          This method returns the value of the jspName attribute if one were found in the xml chart.
 IState getParentState()
          This method retruns the parent of this stateor null if none is set.
 java.util.Iterator getProcesses()
          This method returns the processes used by this object.
 java.util.ArrayList getProcessNamesList()
          Returns the processNamesList.
 java.lang.String getTitle()
          Returns a descriptive title for this state.
 IUnitOfWork getUnitOfWork()
          This method is currently not implemented and returns null.
 java.util.Properties getUserProperties()
          This method is not implemented currently.
 IView getView()
          This method returns the view class for this state
 java.util.Properties getViewProperties()
          Returns the viewProperties.
 void initializeProcessUser(java.util.Map processMap)
           
 void setParent(State parent)
          Sets the parent state of this state
 void setProcessNamesList(java.util.ArrayList processNamesList)
          Sets the processNamesList.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

State

public State(org.xml.sax.Attributes atts,
             Application application)
This constructor creates a new State, the State is initialised with the attribute set given.

The attribute set should contain the following attributes:
name, the state id
viewName, the view class used to display this state

Parameters:
atts - org.xml.sax.Attributes
application - com.bankframe.fe.sm.saxapploader.Application the application this State belongs to.
Method Detail

acceptsEvent

public boolean acceptsEvent(IEvent event)
This method is currently not implemented and returns true;

Specified by:
acceptsEvent in interface IState
Parameters:
event -
Returns:
boolean true

acceptsSession

public boolean acceptsSession(IUserSession session)
Returns true if the user session passed in can be in this state. Currently retruns true for all.

Specified by:
acceptsSession in interface IState
Parameters:
session -
Returns:
boolean true

addEvent

public void addEvent(Event event)
This method adds an event to this state if the event indicates that it is a default event then the given event becomes the default event for this state.

Parameters:
event - com.bankframe.fe.sm.saxapploader.Event

equals

public boolean equals(java.lang.Object obj)
This method returns state Id

Parameters:
obj -
Returns:
Id

getDefaultEvent

public IEvent getDefaultEvent()
This method returns the default event for this state.

Specified by:
getDefaultEvent in interface IState
Returns:
defaultEvent

getEvent

public IEvent getEvent(java.lang.String name)
This method returns the event with the given name.

Specified by:
getEvent in interface IState
Parameters:
name - java.lang.String the event name
Returns:
event

getEvents

public java.util.Iterator getEvents()
This method returns an Iterator of Event objects for this state.

Specified by:
getEvents in interface IState
Returns:
java.util.Iterator

getExceptionState

public IState getExceptionState(java.lang.String exceptionDescription)
Returns a State which can be used if the named exception occurs. Currently this method returns this state as the exception state.

Specified by:
getExceptionState in interface IState
Parameters:
exceptionDescription - the exception which has been thrown to RequestManager
Returns:
the state which should be the result of the exception.

getId

public java.lang.String getId()
This method retruns the name of this State.

Specified by:
getId in interface IState
Returns:
java.lang.String the state name

getJSPName

public java.lang.String getJSPName()
This method returns the value of the jspName attribute if one were found in the xml chart.

Returns:
java.lang.String

getParentState

public IState getParentState()
This method retruns the parent of this stateor null if none is set.

Specified by:
getParentState in interface IState
Returns:
the parent state, or null if this is the root state for this applicaiton.

getUnitOfWork

public IUnitOfWork getUnitOfWork()
This method is currently not implemented and returns null.

Specified by:
getUnitOfWork in interface IState
Returns:
unit of work

getUserProperties

public java.util.Properties getUserProperties()
This method is not implemented currently.

Specified by:
getUserProperties in interface IState
Returns:
userProperties

getView

public IView getView()
              throws ViewNotFoundException
This method returns the view class for this state

Specified by:
getView in interface IState
Returns:
view
Throws:
ViewNotFoundException

setParent

public void setParent(State parent)
Sets the parent state of this state


executeStateCommand

public void executeStateCommand(IStateCommand command,
                                boolean recurse)
                         throws StateMachineException
This method executes the given command on this state and (optionally) all child states.

Specified by:
executeStateCommand in interface IState
Parameters:
command - an IStateCommand implementor that performs some operation on states.
recurse - set true if the command is to be executed on the state tree, or false if the command is to be executed on this state only.
Throws:
StateMachineException

getTitle

public java.lang.String getTitle()
Description copied from interface: IState
Returns a descriptive title for this state.

Specified by:
getTitle in interface IState
Returns:
title
See Also:
IState.getTitle()

getInputRequirements

public IInputRequirements getInputRequirements()
Specified by:
getInputRequirements in interface IState
See Also:
IState.getInputRequirements()

getProcesses

public java.util.Iterator getProcesses()
Description copied from interface: IProcessUser
This method returns the processes used by this object.

Specified by:
getProcesses in interface IProcessUser
See Also:
IProcessUser.getProcesses()

getViewProperties

public java.util.Properties getViewProperties()
Returns the viewProperties.

Specified by:
getViewProperties in interface IState
Returns:
Properties

getProcessNamesList

public java.util.ArrayList getProcessNamesList()
Returns the processNamesList.

Returns:
ArrayList

setProcessNamesList

public void setProcessNamesList(java.util.ArrayList processNamesList)
Sets the processNamesList.

Parameters:
processNamesList - The processNamesList to set

initializeProcessUser

public void initializeProcessUser(java.util.Map processMap)

addInputDefinition

public void addInputDefinition(IInputDefinition inputDefinition)

getChildren

public java.util.Iterator getChildren()
Specified by:
getChildren in interface IState


Copyright © 2004 Siebel Systems, Inc. All rights reserved.