Class ViewState
java.lang.Object
org.springframework.webflow.core.AnnotatedObject
org.springframework.webflow.engine.State
org.springframework.webflow.engine.TransitionableState
org.springframework.webflow.engine.ViewState
- All Implemented Interfaces:
- Annotated,- StateDefinition,- TransitionableStateDefinition
A view state is a state that issues a response to the user, for example, for soliciting form input. To accomplish
 this, a 
ViewState delegates to a ViewFactory.- Author:
- Keith Donald, Erwin Vervaet
- See Also:
- 
Field SummaryFields inherited from class org.springframework.webflow.core.AnnotatedObjectCAPTION_PROPERTY, DESCRIPTION_PROPERTY
- 
Constructor SummaryConstructorsConstructorDescriptionViewState(Flow flow, String id, ViewFactory viewFactory) Create a new view state.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddVariable(ViewVariable variable) Adds a view variable.voidaddVariables(ViewVariable... variables) Adds a set of view variables.protected voidappendToString(org.springframework.core.style.ToStringCreator creator) Subclasses may override this hook method to print their internal state to a string.protected voiddoEnter(RequestControlContext context) Hook method to execute custom behavior as a result of entering this state.protected voiddoPreEntryActions(RequestControlContext context) Hook method to execute before running state entry actions upon state entry.voidexit(RequestControlContext context) Exit this state.booleangetPopup()Returns whether this view state should render as a popup.booleanReturns whether this view state should request a flow execution redirect when entered.Returns the list of actions executable by this view state on entry and on refresh.getVariable(String name) Returns the view variable with the given name.Returns the configured view variables.Returns the view factory.booleanReturns true if this state is a view state.voidresume(RequestControlContext context) voidsetPopup(boolean popup) Sets whether this view state should render as a popup.voidsetRedirect(Boolean redirect) Sets whether this view state should requests a flow execution redirect when entered.Methods inherited from class org.springframework.webflow.engine.TransitionableStategetExitActionList, getRequiredTransition, getTransition, getTransitions, getTransitionSet, handleEventMethods inherited from class org.springframework.webflow.engine.Stateenter, equals, getEntryActionList, getExceptionHandlerSet, getFlow, getId, getOwner, handleException, hashCode, isStartState, toStringMethods inherited from class org.springframework.webflow.core.AnnotatedObjectgetAttributes, getCaption, getDescription, setCaption, setDescriptionMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.webflow.core.AnnotatedgetAttributes, getCaption, getDescriptionMethods inherited from interface org.springframework.webflow.definition.StateDefinitiongetId, getOwner
- 
Constructor Details- 
ViewStateCreate a new view state.- Parameters:
- flow- the owning flow
- id- the state identifier (must be unique to the flow)
- viewFactory- the view factory
- Throws:
- IllegalArgumentException- when this state cannot be added to given flow, e.g. because the id is not unique
 
 
- 
- 
Method Details- 
isViewStatepublic boolean isViewState()Description copied from interface:StateDefinitionReturns true if this state is a view state.- Specified by:
- isViewStatein interface- StateDefinition
- Overrides:
- isViewStatein class- State
- Returns:
- true if a view state, false otherwise
 
- 
addVariableAdds a view variable.- Parameters:
- variable- the variable
 
- 
addVariablesAdds a set of view variables.- Parameters:
- variables- the variables
 
- 
getVariableReturns the view variable with the given name.- Parameters:
- name- the name of the variable
 
- 
getVariablesReturns the configured view variables.
- 
getRedirectpublic boolean getRedirect()Returns whether this view state should request a flow execution redirect when entered.
- 
setRedirectSets whether this view state should requests a flow execution redirect when entered.- Parameters:
- redirect- the redirect flag
 
- 
getPopuppublic boolean getPopup()Returns whether this view state should render as a popup.
- 
setPopuppublic void setPopup(boolean popup) Sets whether this view state should render as a popup.- Parameters:
- popup- the popup flag
 
- 
getViewFactoryReturns the view factory.
- 
getRenderActionListReturns the list of actions executable by this view state on entry and on refresh. The returned list is mutable.- Returns:
- the state action list
 
- 
doPreEntryActionsDescription copied from class:StateHook method to execute before running state entry actions upon state entry. Does nothing by default. Subclasses may override.- Overrides:
- doPreEntryActionsin class- State
- Parameters:
- context- the request control context
- Throws:
- FlowExecutionException- if an exception occurs
 
- 
doEnterDescription copied from class:StateHook method to execute custom behavior as a result of entering this state. By implementing this method subclasses specialize the behavior of the state.- Specified by:
- doEnterin class- State
- Parameters:
- context- the control context for the currently executing flow, used by this state to manipulate the flow execution
- Throws:
- FlowExecutionException- if an exception occurs in this state
 
- 
resume
- 
exitDescription copied from class:TransitionableStateExit 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.- Overrides:
- exitin class- TransitionableState
- Parameters:
- context- the flow control context
 
- 
appendToStringprotected void appendToString(org.springframework.core.style.ToStringCreator creator) Description copied from class:StateSubclasses may override this hook method to print their internal state to a string. This default implementation does nothing.- Overrides:
- appendToStringin class- TransitionableState
- Parameters:
- creator- the toString creator, to print properties to string
- See Also:
 
 
-