Class TransitionableState
java.lang.Object
org.springframework.webflow.core.AnnotatedObject
org.springframework.webflow.engine.State
org.springframework.webflow.engine.TransitionableState
- All Implemented Interfaces:
Annotated
,StateDefinition
,TransitionableStateDefinition
- Direct Known Subclasses:
ActionState
,DecisionState
,SubflowState
,ViewState
Abstract superclass for states that can execute a transition in response to an event.
- Author:
- Keith Donald, Erwin Vervaet
- See Also:
-
Field Summary
Fields inherited from class org.springframework.webflow.core.AnnotatedObject
CAPTION_PROPERTY, DESCRIPTION_PROPERTY
-
Constructor Summary
ModifierConstructorDescriptionprotected
TransitionableState
(Flow flow, String id) Create a new transitionable state. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendToString
(org.springframework.core.style.ToStringCreator creator) Subclasses may override this hook method to print their internal state to a string.void
exit
(RequestControlContext context) Exit this state.Returns the list of actions executed by this state when it is exited.getRequiredTransition
(RequestContext context) Get a transition in this state for given flow execution request context.getTransition
(String eventId) Returns the transition that matches the event with the provided id.Returns the available transitions out of this state.Returns the set of transitions.boolean
handleEvent
(RequestControlContext context) Inform this state definition that an event was signaled in it.Methods inherited from class org.springframework.webflow.engine.State
doEnter, doPreEntryActions, enter, equals, getEntryActionList, getExceptionHandlerSet, getFlow, getId, getOwner, handleException, hashCode, isStartState, isViewState, toString
Methods inherited from class org.springframework.webflow.core.AnnotatedObject
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.core.Annotated
getAttributes, getCaption, getDescription
Methods inherited from interface org.springframework.webflow.definition.StateDefinition
getId, getOwner, isViewState
-
Constructor Details
-
TransitionableState
Create a new transitionable state.- Parameters:
flow
- the owning flowid
- the state identifier (must be unique to the flow)- Throws:
IllegalArgumentException
- when this state cannot be added to given flow, for instance when the id is not unique- See Also:
-
-
Method Details
-
getTransitions
Description copied from interface:TransitionableStateDefinition
Returns the available transitions out of this state.- Specified by:
getTransitions
in interfaceTransitionableStateDefinition
- Returns:
- the available state transitions
-
getTransition
Description copied from interface:TransitionableStateDefinition
Returns the transition that matches the event with the provided id.- Specified by:
getTransition
in interfaceTransitionableStateDefinition
- Parameters:
eventId
- the event id- Returns:
- the transition that matches, or null if no match is found.
-
getTransitionSet
Returns the set of transitions. The returned set is mutable. -
getRequiredTransition
public Transition getRequiredTransition(RequestContext context) throws NoMatchingTransitionException Get a transition in this state for given flow execution request context. Throws and exception when there is no corresponding transition.- Throws:
NoMatchingTransitionException
- when a matching transition cannot be found
-
getExitActionList
Returns the list of actions executed by this state when it is exited. The returned list is mutable.- Returns:
- the state exit action list
-
handleEvent
Inform this state definition that an event was signaled in it. The signaled event is the last event available in given request context (RequestContext.getCurrentEvent()
).- Parameters:
context
- the flow execution control context- Throws:
NoMatchingTransitionException
- when a matching transition cannot be found
-
exit
Exit this state. This is typically called when a transition takes the flow out of this state into another state. By default just executes any registered exit actions.- Parameters:
context
- the flow control context
-
appendToString
protected void appendToString(org.springframework.core.style.ToStringCreator creator) Description copied from class:State
Subclasses may override this hook method to print their internal state to a string. This default implementation does nothing.- Overrides:
appendToString
in classState
- Parameters:
creator
- the toString creator, to print properties to string- See Also:
-