com.opensymphony.module.propertyset
Class MapPropertySet

java.lang.Object
  |
  +--com.opensymphony.module.propertyset.AbstractPropertySet
        |
        +--com.opensymphony.module.propertyset.MapPropertySet
All Implemented Interfaces:
PropertySet

public class MapPropertySet
extends AbstractPropertySet

The MapPropertySet is an UNTYPED PropertySet implementation that acts as a wrapper around a standard Map .

Because Map's will only store the value but not the type, this is untyped. See PropertySet for explanation.

Version:
$Revision: 1.4 $
Author:
Joe Walnes
See Also:
PropertySet

Field Summary
protected  java.util.Map map
          Underlying Map storing properties.
 
Fields inherited from class com.opensymphony.module.propertyset.AbstractPropertySet
schema
 
Fields inherited from interface com.opensymphony.module.propertyset.PropertySet
BOOLEAN, DATA, DATE, DOUBLE, INT, LONG, OBJECT, PROPERTIES, STRING, TEXT, XML
 
Constructor Summary
MapPropertySet()
          Create new MapPropertySet and use a new HashMap as underlying Map.
MapPropertySet(java.util.Map map)
          Create new MapPropertySet and use supplied Map as underlying Map.
 
Method Summary
 boolean exists(java.lang.String key)
          Determine if property exists.
protected  java.lang.Object get(int type, java.lang.String key)
          The type parameter is ignored.
 java.util.Collection getKeys(java.lang.String prefix, int type)
          The type parameter is ignored.
 java.util.Map getMap()
          Retrieve underlying map.
 int getType(java.lang.String key)
          This is an untyped PropertySet implementation so this method will always throw UnsupportedOperationException .
 void remove(java.lang.String key)
          Removes property.
protected  void setImpl(int type, java.lang.String key, java.lang.Object value)
          The type parameter is ignored.
 void setMap(java.util.Map map)
          Set underlying map.
 boolean supportsType(int type)
          Returns false.
 boolean supportsTypes()
          Returns false.
 
Methods inherited from class com.opensymphony.module.propertyset.AbstractPropertySet
getBoolean, getData, getDate, getDouble, getInt, getKeys, getKeys, getKeys, getLong, getObject, getProperties, getSchema, getString, getText, getXML, isSettable, setAsActualType, setBoolean, setData, setDate, setDouble, setInt, setLong, setObject, setProperties, setSchema, setString, setText, setXML, toString, type, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

map

protected java.util.Map map
Underlying Map storing properties.
Constructor Detail

MapPropertySet

public MapPropertySet()
Create new MapPropertySet and use a new HashMap as underlying Map.

MapPropertySet

public MapPropertySet(java.util.Map map)
Create new MapPropertySet and use supplied Map as underlying Map.
Method Detail

getMap

public java.util.Map getMap()
Retrieve underlying map.

setMap

public void setMap(java.util.Map map)
Set underlying map.

get

protected java.lang.Object get(int type,
                               java.lang.String key)
The type parameter is ignored.
Overrides:
get in class AbstractPropertySet

setImpl

protected void setImpl(int type,
                       java.lang.String key,
                       java.lang.Object value)
The type parameter is ignored.
Overrides:
setImpl in class AbstractPropertySet

exists

public boolean exists(java.lang.String key)
Description copied from interface: PropertySet
Determine if property exists.
Overrides:
exists in class AbstractPropertySet

remove

public void remove(java.lang.String key)
Description copied from interface: PropertySet
Removes property.
Overrides:
remove in class AbstractPropertySet

getType

public int getType(java.lang.String key)
            throws java.lang.UnsupportedOperationException
This is an untyped PropertySet implementation so this method will always throw UnsupportedOperationException .
Overrides:
getType in class AbstractPropertySet
Following copied from interface: com.opensymphony.module.propertyset.PropertySet
Returns:
Type of value. See static class variables.

getKeys

public java.util.Collection getKeys(java.lang.String prefix,
                                    int type)
The type parameter is ignored.
Overrides:
getKeys in class AbstractPropertySet
Following copied from interface: com.opensymphony.module.propertyset.PropertySet
Parameters:
prefix - String that keys must start with. If null, than all keys shall be returned.
type - Type to list. See static class variables. If null, then all types shall be returned.
Returns:
Unmodifiable Collection of Strings.

supportsTypes

public boolean supportsTypes()
Returns false.
Overrides:
supportsTypes in class AbstractPropertySet

supportsType

public boolean supportsType(int type)
Returns false.
Overrides:
supportsType in class AbstractPropertySet

See www.opensymphony.com for more information.