-
- All Superinterfaces:
- StateHolder
public interface StateHelper extends StateHolder
Define a
Map
-like contract that makes it easier for components to implementPartialStateHolder
. EachUIComponent
in the view will return an implementation of this interface from itsUIComponent.getStateHelper()
method.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description void
add(Serializable key, Object value)
Store the specified
value
in aList
that is internal to theStateHelper
.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.
Object
eval(Serializable key, Object defaultValue)
Performs the same logic as
eval(java.io.Serializable)
} but if no value is found, this will return the specifieddefaultValue
Object
get(Serializable key)
Return the value currently associated with the specified
key
if any.Object
put(Serializable key, Object value)
Return the previously stored value and store the specified key/value pair.
Object
put(Serializable key, String mapKey, Object value)
Store the specified
mapKey
/value
in aMap
that is internal to the helper, and return the previously stored value.Object
remove(Serializable key)
Remove the key/value pair from the helper, returning the value previously stored under this key.
Object
remove(Serializable key, Object valueOrKey)
Remove a value from the inner data structure.
-
Methods inherited from interface javax.faces.component.StateHolder
isTransient, restoreState, saveState, setTransient
-
-
-
-
Method Detail
-
put
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.
- Parameters:
key
- the key for the valuevalue
- the value- Since:
- 2.0
-
remove
Object remove(Serializable key)
Remove the key/value pair from the helper, returning the value previously stored under this key.
- Parameters:
key
- the key to remove- Since:
- 2.0
-
put
Object put(Serializable key, String mapKey, Object value)
Store the specified
mapKey
/value
in aMap
that is internal to the helper, and return the previously stored value. TheMap
will then be associated withkey
.It's important to note for delta tracking that any modifications to the internal
Map
be made through this method orremove(java.io.Serializable, Object)
.- Parameters:
key
- the key of the map itselfmapKey
- the key within the internal mapvalue
- the value for the key in the internal map- Since:
- 2.0
-
get
Object get(Serializable 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.0
-
eval
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.
- Parameters:
key
- the name of the value in the internal map, or the name of a value expression in the components value expression collection.- Since:
- 2.0
-
eval
Object eval(Serializable key, Object defaultValue)
Performs the same logic as
eval(java.io.Serializable)
} but if no value is found, this will return the specifieddefaultValue
- Parameters:
key
- the key for which the value should be returned.defaultValue
- the value to return if no value is found in the call toeval()
.- Since:
- 2.0
-
add
void add(Serializable key, Object value)
Store the specified
value
in aList
that is internal to theStateHelper
.It's important to note for delta tracking that any modifications to the internal
List
be made through this method orremove(java.io.Serializable, Object)
.- Parameters:
key
- the key for which the value should be returned.value
- the value to add- Since:
- 2.0
-
remove
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 aMap
, remove and return the value under the key given by thevalueOrKey
argument. If the value is aCollection
, simply remove the value given by the argumentvalueOrKey
and return null.- Parameters:
key
- the key of in the inner data structure whose value is aCollection
orMap
valueOrKey
- the value or key to be removed.
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/08/2025 16:58:56 Cette version de la page est en cache (à la date du 21/08/2025 16:58:56) afin d'accélérer le traitement.Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la version plus récente de la page.
Document créé le 11/06/2005, dernière modification le 18/08/2025
Source du document imprimé : https://www.gaudry.be/java-api-javaee-rf-javax/faces/component/StateHelper.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.