Class ViewVariable

java.lang.Object
org.springframework.webflow.core.AnnotatedObject
org.springframework.webflow.engine.ViewVariable
All Implemented Interfaces:
Annotated

public class ViewVariable extends AnnotatedObject
A variable scoped to a particular view. Such a variable is allocated when a view-state is entered and destroyed when that view-state exits. The flow scope map is used as the backing variable store.
Author:
Keith Donald
  • Constructor Details

    • ViewVariable

      public ViewVariable(String name, VariableValueFactory valueFactory)
      Creates a new view variable.
      Parameters:
      name - the name of the variable
      valueFactory - the source for the variable value
  • Method Details

    • getName

      public String getName()
      Returns the name of this view variable.
    • getValueFactory

      public VariableValueFactory getValueFactory()
      Returns the source of the variable's initial value.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • create

      public void create(RequestContext context)
      Creates this view variable. This method allocates the variable's value in flow scope.
      Parameters:
      context - the executing flow
    • restore

      public void restore(RequestContext context)
      Restores this view variable's dependencies. This method asks the variable's value factory to restore any references the variable has to transient objects.
      Parameters:
      context - the executing flow
    • destroy

      public Object destroy(RequestContext context)
      Destroy this view variable. This method removes the variable's value in flow scope.
      Parameters:
      context - the executing flow