Home » Mojarra-2.0.1 » javax » faces » component » [javadoc | source]
javax.faces.component
public interface: StateHelper [javadoc | source]

All Implemented Interfaces:
    StateHolder

All Known Implementing Classes:
    ComponentStateHelper

Define a Map-like contract that makes it easier for components to implement PartialStateHolder . Each UIComponent in the view will return an implementation of this interface from its UIComponent#getStateHelper method.

Method from javax.faces.component.StateHelper Summary:
add,   eval,   eval,   get,   put,   put,   remove,   remove
Method from javax.faces.component.StateHelper Detail:
 public  void add(Serializable key,
    Object value)

    Store the specified value in a List that is internal to the StateHelper.

    It's important to note for delta tracking that any modifications to the internal List be made through this method or StateHelper#remove(java.io.Serializable, Object) .

 public Object eval(Serializable key)

    Attempts to find a value associated with the specified key, using the value expression collection from the component if no such value is found.

 public Object eval(Serializable key,
    Object defaultValue)
 public Object get(Serializable key)

    Return the value currently associated with the specified key if any.

 public Object put(Serializable key,
    Object value)

    Return the previously stored value and store the specified key/value pair. This is intended to store data that would otherwise reside in an instance variable on the component.

 public Object put(Serializable key,
    String mapKey,
    Object value)

    Store the specified mapKey/value in a Map that is internal to the helper, and return the previously stored value. The Map will then be associated with key.

    It's important to note for delta tracking that any modifications to the internal Map be made through this method or StateHelper#remove(java.io.Serializable, Object) .

 public Object remove(Serializable key)

    Remove the key/value pair from the helper, returning the value previously stored under this key.

 public Object remove(Serializable key,
    Object valueOrKey)

    Remove a value from the inner data structure. Look in the inner data structure for the value at the given key. If the value is a Map, remove and return the value under the key given by the valueOrKey argument. If the value is a Collection, simply remove the value given by the argument valueOrKey and return null.