|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.webflow.engine.AnnotatedObject
org.springframework.webflow.engine.State
public abstract class State
A point in a flow where something happens. What happens is determined by a state's type. Standard types of states include action states, view states, subflow states, and end states.
Each state is associated with exactly one owning flow definition. Specializations of this class capture all the configuration information needed for a specific kind of state.
Subclasses should implement the doEnter
method to execute the processing that should occur when this
state is entered, acting on its configuration information. The ability to plugin custom state types that execute
different behaviour polymorphically is the classic GoF state pattern.
Equality: Two states are equal if they have the same id and are part of the same flow.
TransitionableState
,
ActionState
,
ViewState
,
SubflowState
,
EndState
,
DecisionState
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
Logger, for use in subclasses. |
Fields inherited from class org.springframework.webflow.engine.AnnotatedObject |
---|
CAPTION_PROPERTY, DESCRIPTION_PROPERTY |
Constructor Summary | |
---|---|
protected |
State(Flow flow,
java.lang.String id)
Creates a state for the provided flow identified by the provided id . |
Method Summary | |
---|---|
protected void |
appendToString(org.springframework.core.style.ToStringCreator creator)
Subclasses may override this hook method to stringify their internal state. |
protected abstract ViewSelection |
doEnter(RequestControlContext context)
Hook method to execute custom behaviour as a result of entering this state. |
ViewSelection |
enter(RequestControlContext context)
Enter this state in the provided flow control context. |
boolean |
equals(java.lang.Object o)
|
ActionList |
getEntryActionList()
Returns the list of actions executed by this state when it is entered. |
FlowExecutionExceptionHandlerSet |
getExceptionHandlerSet()
Returns a mutable set of exception handlers, allowing manipulation of how exceptions are handled when thrown within this state. |
Flow |
getFlow()
Returns the owning flow. |
java.lang.String |
getId()
Returns this state's identifier, locally unique to is containing flow definition. |
FlowDefinition |
getOwner()
Returns the flow definition this state belongs to. |
ViewSelection |
handleException(FlowExecutionException exception,
RequestControlContext context)
Handle an exception that occured in this state during the context of the current flow execution request. |
int |
hashCode()
|
boolean |
isStartState()
Returns a flag indicating if this state is the start state of its owning flow. |
java.lang.String |
toString()
|
Methods inherited from class org.springframework.webflow.engine.AnnotatedObject |
---|
getAttributeMap, getAttributes, getCaption, getDescription, setCaption, setDescription |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.webflow.definition.Annotated |
---|
getAttributes, getCaption, getDescription |
Field Detail |
---|
protected final org.apache.commons.logging.Log logger
Constructor Detail |
---|
protected State(Flow flow, java.lang.String id) throws java.lang.IllegalArgumentException
flow
identified by the provided id
. The id must
be locally unique to the owning flow. The state will be automatically added to the flow.
flow
- the owning flowid
- the state identifier (must be unique to the flow)
java.lang.IllegalArgumentException
- if this state cannot be added to the flow, for instance when the provided id is
not unique in the owning flowgetEntryActionList()
,
getExceptionHandlerSet()
Method Detail |
---|
public FlowDefinition getOwner()
StateDefinition
getOwner
in interface StateDefinition
public java.lang.String getId()
StateDefinition
getId
in interface StateDefinition
public Flow getFlow()
public ActionList getEntryActionList()
public FlowExecutionExceptionHandlerSet getExceptionHandlerSet()
Exception handlers are invoked when an exception occurs when this state is entered, and can execute custom exception handling logic as well as select an error view to display.
public boolean isStartState()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public final ViewSelection enter(RequestControlContext context) throws FlowExecutionException
doEnter(RequestControlContext)
hook method, which should be implemented by subclasses, after executing
the entry actions.
context
- the control context for the currently executing flow, used by this state to manipulate the flow
execution
FlowExecutionException
- if an exception occurs in this stateprotected abstract ViewSelection doEnter(RequestControlContext context) throws FlowExecutionException
context
- the control context for the currently executing flow, used by this state to manipulate the flow
execution
FlowExecutionException
- if an exception occurs in this statepublic ViewSelection handleException(FlowExecutionException exception, RequestControlContext context)
exception
- the exception that occuredcontext
- the flow execution control context
null
if no handler matched or returned a non-null view
selectionpublic java.lang.String toString()
toString
in class java.lang.Object
protected void appendToString(org.springframework.core.style.ToStringCreator creator)
creator
- the toString creator, to stringify properties
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |