org.apache.myfaces.trinidad.bean
Class AttachedObjects<K,T>

java.lang.Object
  extended by org.apache.myfaces.trinidad.bean.AttachedObjects<K,T>
All Implemented Interfaces:
javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder

public class AttachedObjects<K,T>
extends Object
implements javax.faces.component.PartialStateHolder

Class for managing attached object on the component that are maintained as a Map of Lists


Constructor Summary
AttachedObjects()
           
 
Method Summary
 void addAttachedObject(K key, T obj)
          Adds attached object to this collection.
 void clearInitialState()
           
 List<T> getAttachedObjectList(K key)
          Retrieves a non-null immutable list of objects for this key from the collection.
 Map<K,List<T>> getAttachedObjectMap()
          Retreives a map of objects contained in this collection.
 boolean initialStateMarked()
           
 boolean isTransient()
           
 void markInitialState()
           
 boolean removeAttachedObject(K key, T obj)
          Removes an object from this collection
 void restoreState(javax.faces.context.FacesContext facesContext, Object state)
           
 Object saveState(javax.faces.context.FacesContext facesContext)
           
 void setTransient(boolean newTransientValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachedObjects

public AttachedObjects()
Method Detail

addAttachedObject

public final void addAttachedObject(K key,
                                    T obj)
Adds attached object to this collection. The key for the object does not have to be unique.

Parameters:
key - Object key
obj - Object value

removeAttachedObject

public final boolean removeAttachedObject(K key,
                                          T obj)
Removes an object from this collection

Parameters:
key - Object key
obj - Object value
Returns:
true if the object fas found and removed, false otherwise

getAttachedObjectList

public final List<T> getAttachedObjectList(K key)
Retrieves a non-null immutable list of objects for this key from the collection.

Parameters:
key - Key value shared by all the objects in the List
Returns:
a list of objects for the given key

getAttachedObjectMap

public final Map<K,List<T>> getAttachedObjectMap()
Retreives a map of objects contained in this collection.

Returns:
a non-null immutable map of objects

markInitialState

public void markInitialState()
Specified by:
markInitialState in interface javax.faces.component.PartialStateHolder

clearInitialState

public void clearInitialState()
Specified by:
clearInitialState in interface javax.faces.component.PartialStateHolder

initialStateMarked

public boolean initialStateMarked()
Specified by:
initialStateMarked in interface javax.faces.component.PartialStateHolder

saveState

public Object saveState(javax.faces.context.FacesContext facesContext)
Specified by:
saveState in interface javax.faces.component.StateHolder

restoreState

public void restoreState(javax.faces.context.FacesContext facesContext,
                         Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder

isTransient

public boolean isTransient()
Specified by:
isTransient in interface javax.faces.component.StateHolder

setTransient

public void setTransient(boolean newTransientValue)
Specified by:
setTransient in interface javax.faces.component.StateHolder


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.