|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StateHelper
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 Summary | |
---|---|
void |
add(java.io.Serializable key,
java.lang.Object value)
Store the specified
|
java.lang.Object |
eval(java.io.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. |
java.lang.Object |
eval(java.io.Serializable key,
java.lang.Object defaultValue)
Performs the same logic as |
java.lang.Object |
get(java.io.Serializable key)
Return the value currently
associated with the specified |
java.lang.Object |
put(java.io.Serializable key,
java.lang.Object value)
Return the previously stored value and store the specified key/value pair. |
java.lang.Object |
put(java.io.Serializable key,
java.lang.String mapKey,
java.lang.Object value)
Store the specified
|
java.lang.Object |
remove(java.io.Serializable key)
Remove the key/value pair from the helper, returning the value previously stored under this key. |
java.lang.Object |
remove(java.io.Serializable key,
java.lang.Object valueOrKey)
Remove a value from the inner data structure. |
Methods inherited from interface javax.faces.component.StateHolder |
---|
isTransient, restoreState, saveState, setTransient |
Method Detail |
---|
java.lang.Object put(java.io.Serializable key, java.lang.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.
key
- the key for the valuevalue
- the valuejava.lang.Object remove(java.io.Serializable key)
Remove the key/value pair from the helper, returning the value previously stored under this key.
key
- the key to removejava.lang.Object put(java.io.Serializable key, java.lang.String mapKey, java.lang.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)
.
key
- the key of the map itselfmapKey
- the key within the internal mapvalue
- the value for the key in the internal mapjava.lang.Object get(java.io.Serializable key)
Return the value currently
associated with the specified key
if any.
key
- the key for which the value should be returned.java.lang.Object eval(java.io.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.
key
- the name of the value in the internal map, or the name
of a value expression in the components value expression
collection.java.lang.Object eval(java.io.Serializable key, java.lang.Object defaultValue)
Performs the same logic as eval(java.io.Serializable)
} but if no value is found, this
will return the specified defaultValue
key
- the key for which the value should be returned.defaultValue
- the value to return if no value is found in
the call to eval()
.void add(java.io.Serializable key, java.lang.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)
.
key
- the key for which the value should be returned.value
- the value to addjava.lang.Object remove(java.io.Serializable key, java.lang.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.
key
- the key of in the inner data structure whose value is
a Collection
or Map
valueOrKey
- the value or key to be removed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.
Generated on 10-February-2011 12:41