Spring Web Flow

org.springframework.webflow.engine
Class ViewVariable

java.lang.Object
  

extended by org.springframework.webflow.core.AnnotatedObject
      extended by 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

Field Summary
 
Fields inherited from class org.springframework.webflow.core.AnnotatedObject
CAPTION_PROPERTY, DESCRIPTION_PROPERTY
 
Constructor Summary
ViewVariable(java.lang.String name, VariableValueFactory valueFactory)
          Creates a new view variable.
 
Method Summary
 void create(RequestContext context)
          Creates this view variable.
 java.lang.Object destroy(RequestContext context)
          Destroy this view variable.
 boolean equals(java.lang.Object o)
           
 java.lang.String getName()
          Returns the name of this view variable.
 VariableValueFactory getValueFactory()
          Returns the source of the variable's initial value.
 int hashCode()
           
 void restore(RequestContext context)
          Restores this view variable's dependencies.
 
Methods inherited from class org.springframework.webflow.core.AnnotatedObject
getAttributes, getCaption, getDescription, setCaption, setDescription
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewVariable

public ViewVariable(java.lang.String name,
                    VariableValueFactory valueFactory)
Creates a new view variable.

Parameters:
name - the name of the variable
valueFactory - the source for the variable value
Method Detail

getName

public java.lang.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(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.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 java.lang.Object destroy(RequestContext context)
Destroy this view variable. This method removes the variable's value in flow scope.

Parameters:
context - the executing flow

Spring Web Flow