org.springframework.webflow.engine
Class ViewState

java.lang.Object
  extended by org.springframework.webflow.engine.AnnotatedObject
      extended by org.springframework.webflow.engine.State
          extended by org.springframework.webflow.engine.TransitionableState
              extended by org.springframework.webflow.engine.ViewState
All Implemented Interfaces:
Annotated, StateDefinition, TransitionableStateDefinition

public class ViewState
extends TransitionableState

A view state is a state that issues a response to the user, for example, for soliciting form input.

To accomplish this, a ViewState makes a ViewSelection, which contains the necessary information to issue a suitable response.

Author:
Keith Donald, Erwin Vervaet
See Also:
ViewSelector

Field Summary
 
Fields inherited from class org.springframework.webflow.engine.State
logger
 
Fields inherited from class org.springframework.webflow.engine.AnnotatedObject
CAPTION_PROPERTY, DESCRIPTION_PROPERTY
 
Constructor Summary
ViewState(Flow flow, java.lang.String id)
          Create a new view state.
 
Method Summary
protected  void appendToString(org.springframework.core.style.ToStringCreator creator)
          Subclasses may override this hook method to stringify their internal state.
protected  ViewSelection doEnter(RequestControlContext context)
          Specialization of State's doEnter template method that executes behavior specific to this state type in polymorphic fashion.
 ActionList getRenderActionList()
          Returns the list of actions executable by this view state on entry and on refresh.
 ViewSelector getViewSelector()
          Returns the strategy used to select the view to render in this view state.
 ViewSelection refresh(RequestContext context)
          Request that the current view selection be reconstituted to support reissuing the response.
 void setViewSelector(ViewSelector viewSelector)
          Sets the strategy used to select the view to render in this view state.
 
Methods inherited from class org.springframework.webflow.engine.TransitionableState
exit, getExitActionList, getRequiredTransition, getTransitions, getTransitionSet, onEvent, reenter
 
Methods inherited from class org.springframework.webflow.engine.State
enter, equals, getEntryActionList, getExceptionHandlerSet, getFlow, getId, getOwner, handleException, hashCode, isStartState, 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.StateDefinition
getId, getOwner
 
Methods inherited from interface org.springframework.webflow.definition.Annotated
getAttributes, getCaption, getDescription
 

Constructor Detail

ViewState

public ViewState(Flow flow,
                 java.lang.String id)
          throws java.lang.IllegalArgumentException
Create a new view state.

Parameters:
flow - the owning flow
id - the state identifier (must be unique to the flow)
Throws:
java.lang.IllegalArgumentException - when this state cannot be added to given flow, e.g. because the id is not unique
Method Detail

getViewSelector

public ViewSelector getViewSelector()
Returns the strategy used to select the view to render in this view state.


setViewSelector

public void setViewSelector(ViewSelector viewSelector)
Sets the strategy used to select the view to render in this view state.


getRenderActionList

public ActionList getRenderActionList()
Returns the list of actions executable by this view state on entry and on refresh. The returned list is mutable.

Returns:
the state action list

doEnter

protected ViewSelection doEnter(RequestControlContext context)
                         throws FlowExecutionException
Specialization of State's doEnter template method that executes behavior specific to this state type in polymorphic fashion.

Returns a view selection indicating a response to issue. The view selection typically contains all the data necessary to issue the response.

Specified by:
doEnter in class State
Parameters:
context - the control context for the currently executing flow, used by this state to manipulate the flow execution
Returns:
a view selection serving as a response instruction
Throws:
FlowExecutionException - if an exception occurs in this state

refresh

public ViewSelection refresh(RequestContext context)
                      throws FlowExecutionException
Request that the current view selection be reconstituted to support reissuing the response. This is an idempotent operation that may be safely called any number of times on a paused execution, used primarily to support a flow execution redirect.

Parameters:
context - the request context
Returns:
the view selection
Throws:
FlowExecutionException - if an exception occurs in this state

appendToString

protected void appendToString(org.springframework.core.style.ToStringCreator creator)
Description copied from class: State
Subclasses may override this hook method to stringify their internal state. This default implementation does nothing.

Overrides:
appendToString in class TransitionableState
Parameters:
creator - the toString creator, to stringify properties


Copyright © 2004-2007. All Rights Reserved.