com.ibm.xsp.binding
Class PropertyMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,java.lang.Object>
          extended by com.ibm.xsp.binding.PropertyMap
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,java.lang.Object>

public class PropertyMap
extends java.util.HashMap<java.lang.String,java.lang.Object>

Object that acts as a runtime property container, used for the "compositeData" global objects within custom controls, and some other places.

Note, this does not implement StateHolder, but the items in the map or in some sub-map under it can be StateHolders, so it must be serialized using FacesUtil.objectToSerializable(FacesContext, Object) or StateHolderUtil#savePropertyMap(FacesContext, PropertyMap) which both recursively handle StateHolders in this map or any sub-maps (property-type maps). Note, the internal state of sub-maps are not saved using either of those methods, and the internal state of the top level map is only saved in the savePropertyMap method.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
static java.lang.String COMPOSITEDATA
           
 
Constructor Summary
PropertyMap()
           
PropertyMap(int size)
           
 
Method Summary
 void beginEvaluatePropertyType(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, PropertyMap root, java.lang.String metaDataPathFromRoot)
           
 void beginEvaluateRoot(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Not intended to be called by 3rd parties, this is currently invoked on the root property map, that is the property map returned by FacesPropertyProvider.getPropertyMap().
 void beginLazyEvaluate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Note, lazy evaluate has inherent issues; the lazily evaluated bindings will be evaluated in the wrong context, so variables may resolve to incorrect values.
 void endEvaluatePropertyType(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, PropertyMap root, java.lang.String metaDataPathFromRoot)
           
 void endEvaluateRoot(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
 void endLazyEvaluate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
 java.lang.Object get(java.lang.Object key)
           
 boolean getBoolean(java.lang.String name)
          Helper method to get a boolean property value
 byte getByte(java.lang.String name)
          Helper method to get a byte property value
 char getCharacter(java.lang.String name)
          Helper method to get a character property value
 double getDouble(java.lang.String name)
          Helper method to get a double property value
 float getFloat(java.lang.String name)
          Helper method to get a float property value
 int getInteger(java.lang.String name)
          Helper method to get a integer property value
 long getLong(java.lang.String name)
          Helper method to get a long property value
 java.lang.Object getProperty(java.lang.String name)
          Return the named property from the map.
 short getShort(java.lang.String name)
          Helper method to get a short property value
 java.lang.String getString(java.lang.String name)
          Helper method to get a String property value
 javax.faces.el.ValueBinding getValueBinding(java.lang.String name)
          Return the ValueBinding with the specified name
 boolean isTransient()
           
 void restoreRoot(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object state)
           
 java.lang.Object saveRoot(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
 void setBoolean(java.lang.String name, boolean value)
          Helper method to set a boolean property value
 void setByte(java.lang.String name, byte value)
          Helper method to set a byte property value
 void setCharacter(java.lang.String name, char value)
          Helper method to set a character property value
 void setDouble(java.lang.String name, double value)
          Helper method to set a double property value
 void setFloat(java.lang.String name, float value)
          Helper method to set a float property value
 void setInteger(java.lang.String name, int value)
          Helper method to set a integer property value
 void setLong(java.lang.String name, long value)
          Helper method to set a long property value
 void setProperty(java.lang.String name, java.lang.Object value)
          Set the named property into the map.
 void setShort(java.lang.String name, short value)
          Helper method to set a short property value
 void setString(java.lang.String name, java.lang.String value)
          Helper method to set a String property value
 void setTransient(boolean transientFlag)
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

COMPOSITEDATA

public static final java.lang.String COMPOSITEDATA
See Also:
Constant Field Values
Constructor Detail

PropertyMap

public PropertyMap(int size)

PropertyMap

public PropertyMap()
Method Detail

getValueBinding

public javax.faces.el.ValueBinding getValueBinding(java.lang.String name)
Return the ValueBinding with the specified name


get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map<java.lang.String,java.lang.Object>
Overrides:
get in class java.util.HashMap<java.lang.String,java.lang.Object>

beginEvaluateRoot

public void beginEvaluateRoot(javax.faces.context.FacesContext context,
                              javax.faces.component.UIComponent component)
Not intended to be called by 3rd parties, this is currently invoked on the root property map, that is the property map returned by FacesPropertyProvider.getPropertyMap(). The implementation calls beginEvaluatePropertyType(FacesContext, UIComponent, PropertyMap, String) on any nested property maps saved within root map, which would correspond to property-types in the xsp-config definition or to a "Group" in the Custom Control editor's Property Definition tab.

It evaluates any run-time bindings within this property map, within property maps set as a property value, or when a property value is a list of property maps. This is to ensure that the bindings are evaluated within the correct context, at the time of the control tree rendering when the objects in the outer page containing the custom control are still in scope.

Parameters:
context -
component -

endEvaluateRoot

public void endEvaluateRoot(javax.faces.context.FacesContext context,
                            javax.faces.component.UIComponent component)

beginEvaluatePropertyType

public void beginEvaluatePropertyType(javax.faces.context.FacesContext context,
                                      javax.faces.component.UIComponent component,
                                      PropertyMap root,
                                      java.lang.String metaDataPathFromRoot)

endEvaluatePropertyType

public void endEvaluatePropertyType(javax.faces.context.FacesContext context,
                                    javax.faces.component.UIComponent component,
                                    PropertyMap root,
                                    java.lang.String metaDataPathFromRoot)

getProperty

public java.lang.Object getProperty(java.lang.String name)
Return the named property from the map.


setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Set the named property into the map.


setTransient

public void setTransient(boolean transientFlag)

isTransient

public boolean isTransient()

saveRoot

public java.lang.Object saveRoot(javax.faces.context.FacesContext context,
                                 javax.faces.component.UIComponent component)

restoreRoot

public void restoreRoot(javax.faces.context.FacesContext context,
                        javax.faces.component.UIComponent component,
                        java.lang.Object state)

getCharacter

public char getCharacter(java.lang.String name)
                  throws FacesExceptionEx
Helper method to get a character property value

Throws:
FacesExceptionEx

setCharacter

public void setCharacter(java.lang.String name,
                         char value)
Helper method to set a character property value


getByte

public byte getByte(java.lang.String name)
             throws FacesExceptionEx
Helper method to get a byte property value

Throws:
FacesExceptionEx

setByte

public void setByte(java.lang.String name,
                    byte value)
Helper method to set a byte property value


getShort

public short getShort(java.lang.String name)
               throws FacesExceptionEx
Helper method to get a short property value

Throws:
FacesExceptionEx

setShort

public void setShort(java.lang.String name,
                     short value)
Helper method to set a short property value


getInteger

public int getInteger(java.lang.String name)
               throws FacesExceptionEx
Helper method to get a integer property value

Throws:
FacesExceptionEx

setInteger

public void setInteger(java.lang.String name,
                       int value)
Helper method to set a integer property value


getLong

public long getLong(java.lang.String name)
             throws FacesExceptionEx
Helper method to get a long property value

Throws:
FacesExceptionEx

setLong

public void setLong(java.lang.String name,
                    long value)
Helper method to set a long property value


getFloat

public float getFloat(java.lang.String name)
               throws FacesExceptionEx
Helper method to get a float property value

Throws:
FacesExceptionEx

setFloat

public void setFloat(java.lang.String name,
                     float value)
Helper method to set a float property value


getDouble

public double getDouble(java.lang.String name)
                 throws FacesExceptionEx
Helper method to get a double property value

Throws:
FacesExceptionEx

setDouble

public void setDouble(java.lang.String name,
                      double value)
Helper method to set a double property value


getBoolean

public boolean getBoolean(java.lang.String name)
                   throws FacesExceptionEx
Helper method to get a boolean property value

Throws:
FacesExceptionEx

setBoolean

public void setBoolean(java.lang.String name,
                       boolean value)
Helper method to set a boolean property value


getString

public java.lang.String getString(java.lang.String name)
                           throws FacesExceptionEx
Helper method to get a String property value

Throws:
FacesExceptionEx

setString

public void setString(java.lang.String name,
                      java.lang.String value)
Helper method to set a String property value


beginLazyEvaluate

public void beginLazyEvaluate(javax.faces.context.FacesContext context,
                              javax.faces.component.UIComponent component)
Note, lazy evaluate has inherent issues; the lazily evaluated bindings will be evaluated in the wrong context, so variables may resolve to incorrect values.

Parameters:
lazyEvaluate - the lazyEvaluate to set

endLazyEvaluate

public void endLazyEvaluate(javax.faces.context.FacesContext context,
                            javax.faces.component.UIComponent component)