Enum Class ScopeType

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

public enum ScopeType extends 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 Details

    • 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 Details

    • values

      public static ScopeType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ScopeType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getType

      public Class<?> getType()
    • getScope

      public abstract MutableAttributeMap<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