Package org.apache.myfaces.view
Class ViewScopeProxyMap
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,Object>
-
- org.apache.myfaces.view.ViewScopeProxyMap
-
- All Implemented Interfaces:
StateHolder
,Serializable
,Cloneable
,Map<String,Object>
public class ViewScopeProxyMap extends HashMap<String,Object> implements StateHolder
This wrapper has these objectives: - Isolate the part that needs to be saved with the view (viewScopeId) from the part that should remain into session (bean map). This class will be serialized when UIViewRoot.saveState() is called. - Decouple the way how the view scope map is stored. For example, in CDI view scope a session scope bean is used, and in default view scope the same session map is used but using a prefix.- Author:
- Leonardo Uribe
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description ViewScopeProxyMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
Set<Map.Entry<String,Object>>
entrySet()
void
forceDelegateCreation(FacesContext facesContext)
Object
get(Object key)
Map<String,Object>
getDelegate()
String
getViewScopeId()
boolean
isEmpty()
boolean
isTransient()
Set<String>
keySet()
Object
put(String key, Object value)
void
putAll(Map<? extends String,? extends Object> m)
Object
remove(Object key)
void
restoreState(FacesContext context, Object state)
Object
saveState(FacesContext context)
void
setTransient(boolean newTransientValue)
int
size()
Collection<Object>
values()
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Method Detail
-
getViewScopeId
public String getViewScopeId()
-
forceDelegateCreation
public void forceDelegateCreation(FacesContext facesContext)
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<String,Object>
- Overrides:
containsKey
in classHashMap<String,Object>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interfaceMap<String,Object>
- Overrides:
containsValue
in classHashMap<String,Object>
-
clear
public void clear()
-
values
public Collection<Object> values()
-
restoreState
public void restoreState(FacesContext context, Object state)
- Specified by:
restoreState
in interfaceStateHolder
-
saveState
public Object saveState(FacesContext context)
- Specified by:
saveState
in interfaceStateHolder
-
isTransient
public boolean isTransient()
- Specified by:
isTransient
in interfaceStateHolder
-
setTransient
public void setTransient(boolean newTransientValue)
- Specified by:
setTransient
in interfaceStateHolder
-
-