|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component._DeltaStateHelper
public class _DeltaStateHelper
A delta enabled state holder implementing the StateHolder Interface.
Components implementing the PartalStateHolder interface have an initial state and delta states, the initial state is the one holding all root values and deltas store differences to the initial states
For components not implementing partial state saving only the initial states are of importance, everything is stored and restored continously there
The state helper seems to have three internal storage mechanisms: one being a list which stores plain values, one being a key value pair which stores key values in maps add serves the plain list type while put serves the key value type, the third is the value which has to be stored plainly as is!
In other words, this map can be seen as a composite map. It has two maps: initial state map and delta map.If delta map is used (method component.initialStateMarked() ), base or initial state map cannot be changed, since all changes should be tracked on delta map.
The intention of this class is just hold property values and do a clean separation between initial state and delta.
The code from this class comes from a refactor of org.apache.myfaces.trinidad.bean.util.PropertyHashMap
The context from this class comes and that should be taken into account is this:
First request:
Second request (and next ones)
From the previous analysis, the following conclusions arise:
NOTE: The current implementation of StateHelper on RI does not handle stateHolder values internally. To prevent problems when developers create custom components we should do this too. But anyway, the code that handle this case should be let here as comment, if some day this feature is provided. Note than stateHolder aware properties like converter, validator or listeners should deal with StateHolder or PartialStateHolder on component classes.
Constructor Summary | |
---|---|
_DeltaStateHelper(UIComponent component)
|
Method Summary | |
---|---|
void |
add(java.io.Serializable key,
java.lang.Object value)
|
java.lang.Object |
eval(java.io.Serializable key)
|
java.lang.Object |
eval(java.io.Serializable key,
java.lang.Object defaultValue)
|
java.lang.Object |
get(java.io.Serializable key)
|
protected boolean |
isInitialStateMarked()
|
boolean |
isTransient()
|
java.lang.Object |
put(java.io.Serializable key,
java.lang.Object value)
|
java.lang.Object |
put(java.io.Serializable key,
java.lang.String mapKey,
java.lang.Object value)
|
java.lang.Object |
remove(java.io.Serializable key)
|
java.lang.Object |
remove(java.io.Serializable key,
java.lang.Object valueOrKey)
|
void |
restoreState(FacesContext context,
java.lang.Object state)
|
java.lang.Object |
saveState(FacesContext context)
Serializing cod the serialized data structure consists of key value pairs unless the value itself is an internal array or a map in case of an internal array or map the value itself is another array with its initial value myfaces.InternalArray, myfaces.internalMap the internal Array is then mapped to another array the internal Map again is then mapped to a map with key value pairs |
void |
setTransient(boolean transientValue)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public _DeltaStateHelper(UIComponent component)
Method Detail |
---|
protected boolean isInitialStateMarked()
public void add(java.io.Serializable key, java.lang.Object value)
add
in interface StateHelper
public java.lang.Object eval(java.io.Serializable key)
eval
in interface StateHelper
public java.lang.Object eval(java.io.Serializable key, java.lang.Object defaultValue)
eval
in interface StateHelper
public java.lang.Object get(java.io.Serializable key)
get
in interface StateHelper
public java.lang.Object put(java.io.Serializable key, java.lang.Object value)
put
in interface StateHelper
public java.lang.Object put(java.io.Serializable key, java.lang.String mapKey, java.lang.Object value)
put
in interface StateHelper
public java.lang.Object remove(java.io.Serializable key)
remove
in interface StateHelper
public java.lang.Object remove(java.io.Serializable key, java.lang.Object valueOrKey)
remove
in interface StateHelper
public boolean isTransient()
isTransient
in interface StateHolder
public java.lang.Object saveState(FacesContext context)
saveState
in interface StateHolder
public void restoreState(FacesContext context, java.lang.Object state)
restoreState
in interface StateHolder
public void setTransient(boolean transientValue)
setTransient
in interface StateHolder
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |