Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.progeeks.meta.util
Class TypedMap  view TypedMap download TypedMap.java

java.lang.Object
  extended byorg.progeeks.util.beans.BeanChangeSupport
      extended byorg.progeeks.util.ObservableMap
          extended byorg.progeeks.meta.util.TypedMap
All Implemented Interfaces:
java.util.Map, java.io.Serializable, org.progeeks.util.beans.StandardBean

public class TypedMap
extends org.progeeks.util.ObservableMap

A Map implementation providing field-level change notification as well as type information compatible with the core meta-jb property info classes..

Version:
$Revision: 1.5 $

Nested Class Summary
 
Nested classes inherited from class org.progeeks.util.ObservableMap
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
private  java.util.Map properties
           
 
Fields inherited from class org.progeeks.util.ObservableMap
 
Fields inherited from class org.progeeks.util.beans.BeanChangeSupport
 
Constructor Summary
TypedMap()
          Typed map implementation wrapping a HashMap instance.
TypedMap(java.util.Collection infos)
          Typed map implementation using the specified property information.
TypedMap(java.util.Map map)
          Typed map implementation wrapping the specified map.
TypedMap(java.util.Map map, java.util.Collection infos)
          Typed map implementation wrapping the specified map and using the specified property information.
 
Method Summary
 void addProperty(org.progeeks.meta.PropertyInfo info)
          Adds the specified property info to this typed map.
 void addProperty(java.lang.String propertyName, java.lang.Class type)
          Adds the specified property to this typed map, inferring whatever other information is needed to create the property info object.
 void addProperty(java.lang.String propertyName, org.progeeks.meta.MetaClass type)
          Adds the specified property to this typed map, inferring whatever other information is needed to create the property info object.
 void addProperty(java.lang.String propertyName, org.progeeks.meta.PropertyType type)
          Adds the specified property to this typed map, inferring whatever other information is needed to create the property info object.
 org.progeeks.meta.PropertyInfo getPropertyInfo(java.lang.String name)
          Returns the descriptive information for the specified property.
 java.util.Collection getPropertyInfos()
          Returns an unmodifiable collection of property info objects.
static java.util.List getPropertyInfos(java.util.Map map)
          Returns a list of property info objects by inspecting the contents of the map and using simple heuristics to determine value types.
 java.util.Set getPropertyNames()
          Returns the unmodifiable set of property names.
 org.progeeks.meta.PropertyType getPropertyType(java.lang.String name)
          Returns the type for the specified property.
private static org.progeeks.meta.PropertyType getTypeForObject(java.lang.Object obj)
           
 java.util.Iterator propertyNames()
          Returns an iterator over all valid property names.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          A type-safe version of put().
 
Methods inherited from class org.progeeks.util.ObservableMap
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
 
Methods inherited from class org.progeeks.util.beans.BeanChangeSupport
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, hasListeners, removePropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

properties

private java.util.Map properties
Constructor Detail

TypedMap

public TypedMap()
Typed map implementation wrapping a HashMap instance.


TypedMap

public TypedMap(java.util.Map map)
Typed map implementation wrapping the specified map.


TypedMap

public TypedMap(java.util.Map map,
                java.util.Collection infos)
Typed map implementation wrapping the specified map and using the specified property information.


TypedMap

public TypedMap(java.util.Collection infos)
Typed map implementation using the specified property information.

Method Detail

getTypeForObject

private static org.progeeks.meta.PropertyType getTypeForObject(java.lang.Object obj)

getPropertyInfos

public static java.util.List getPropertyInfos(java.util.Map map)
Returns a list of property info objects by inspecting the contents of the map and using simple heuristics to determine value types.


put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
A type-safe version of put().


addProperty

public void addProperty(java.lang.String propertyName,
                        org.progeeks.meta.PropertyType type)
Adds the specified property to this typed map, inferring whatever other information is needed to create the property info object.


addProperty

public void addProperty(java.lang.String propertyName,
                        org.progeeks.meta.MetaClass type)
Adds the specified property to this typed map, inferring whatever other information is needed to create the property info object.


addProperty

public void addProperty(java.lang.String propertyName,
                        java.lang.Class type)
Adds the specified property to this typed map, inferring whatever other information is needed to create the property info object.


addProperty

public void addProperty(org.progeeks.meta.PropertyInfo info)
Adds the specified property info to this typed map.


getPropertyType

public org.progeeks.meta.PropertyType getPropertyType(java.lang.String name)
Returns the type for the specified property.


getPropertyInfo

public org.progeeks.meta.PropertyInfo getPropertyInfo(java.lang.String name)
Returns the descriptive information for the specified property.


propertyNames

public java.util.Iterator propertyNames()
Returns an iterator over all valid property names.


getPropertyNames

public java.util.Set getPropertyNames()
Returns the unmodifiable set of property names.


getPropertyInfos

public java.util.Collection getPropertyInfos()
Returns an unmodifiable collection of property info objects.