Spring Web Flow

org.springframework.webflow.execution
Enum ScopeType

java.lang.Object
  extended by java.lang.Enum<ScopeType>
      extended by org.springframework.webflow.execution.ScopeType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ScopeType>

public enum ScopeType
extends java.lang.Enum<ScopeType>

An enumeration of the core scope types of Spring Web Flow. Provides easy access to each scope by type using getScope(RequestContext).

A "scope" defines a data structure for storing custom user attributes within a flow execution. Different scope types have different semantics in terms of how long attributes placed in those scope maps remain valid.

Author:
Keith Donald, Erwin Vervaet

Enum Constant Summary
CONVERSATION
          The "conversation" scope type.
FLASH
          The "flash" scope type.
FLOW
          The "flow" scope type.
REQUEST
          The "request" scope type.
VIEW
          The "view" scope type.
 
Method Summary
abstract  MutableAttributeMap<java.lang.Object> getScope(RequestContext context)
          Accessor that returns the mutable attribute map for this scope type for a given flow execution request context.
 java.lang.Class<?> getType()
           
static ScopeType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ScopeType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

REQUEST

public static final ScopeType REQUEST
The "request" scope type. Attributes placed in request scope exist for the life of the current request into the flow execution. When the request ends any attributes in request scope go out of scope.


FLASH

public static final ScopeType FLASH
The "flash" scope type. Attributes placed in flash scope exist through the life of the current request and until the next view rendering. After the view renders, flash scope is cleared.

Flash scope is typically used to store messages that should be preserved until after the next view renders.


VIEW

public static final ScopeType VIEW
The "view" scope type. Attributes placed in view scope exist through the life of the current view state and until the view state exits in a subsequent request.

View scope is typically used to store view model objects manipulated over a series of Ajax requests.


FLOW

public static final ScopeType FLOW
The "flow" scope type. Attributes placed in flow scope exist through the life of an executing flow session, representing an instance a single flow definition. When the flow session ends any data in flow scope goes out of scope.


CONVERSATION

public static final ScopeType CONVERSATION
The "conversation" scope type. Attributes placed in conversation scope are shared by all flow sessions started within a flow execution and live for the life of the entire flow execution (representing a single logical user conversation). When the governing execution ends, any data in conversation scope goes out of scope.

Method Detail

values

public static ScopeType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ScopeType c : ScopeType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ScopeType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getType

public java.lang.Class<?> getType()

getScope

public abstract MutableAttributeMap<java.lang.Object> getScope(RequestContext context)
Accessor that returns the mutable attribute map for this scope type for a given flow execution request context.

Parameters:
context - the context representing an executing request
Returns:
the scope map of this type for that request, allowing attributes to be accessed and set

Spring Web Flow