javax.faces.component
Interface TransientStateHelper

All Superinterfaces:
TransientStateHolder

public interface TransientStateHelper
extends TransientStateHolder

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

The values retrieved or saved through #getTransient(java.io.Serializable) } or #putTransient(java.io.Serializable, Object value) } will not be preserved between requests.

Since:
2.1
Version:
$Revision: 1187701 $ $Date: 2011-10-22 07:21:54 -0500 (Sat, 22 Oct 2011) $
Author:
Leonardo Uribe (latest modification by $Author: bommel $)

Method Summary
 Object getTransient(Object key)
          Return the value currently associated with the specified key if any.
 Object getTransient(Object key, Object defaultValue)
          Performs the same logic as #getTransient(java.io.Serializable) } but if no value is found, this will return the specified defaultValue
 Object putTransient(Object key, Object value)
          Return the previously stored value and store the specified key/value pair.
 
Methods inherited from interface javax.faces.component.TransientStateHolder
restoreTransientState, saveTransientState
 

Method Detail

getTransient

Object getTransient(Object key)

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

Parameters:
key - the key for which the value should be returned.
Since:
2.1

getTransient

Object getTransient(Object key,
                    Object defaultValue)

Performs the same logic as #getTransient(java.io.Serializable) } but if no value is found, this will return the specified defaultValue

Parameters:
key - the key for which the value should be returned.
defaultValue - the value to return if no value is found in the call to get().
Since:
2.1

putTransient

Object putTransient(Object 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.

Parameters:
key - the key for the value
value - the value
Since:
2.1


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.