org.riotfamily.common.beans
Class MapWrapper

java.lang.Object
  extended by org.springframework.beans.PropertyEditorRegistrySupport
      extended by org.springframework.beans.AbstractPropertyAccessor
          extended by org.riotfamily.common.beans.MapWrapper
All Implemented Interfaces:
ObjectWrapper, ConfigurablePropertyAccessor, PropertyAccessor, PropertyEditorRegistry, TypeConverter

public class MapWrapper
extends AbstractPropertyAccessor
implements ObjectWrapper

PropertyAccessor implementation that works on maps.


Field Summary
 
Fields inherited from interface org.springframework.beans.PropertyAccessor
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR
 
Constructor Summary
MapWrapper(Class<?> mapClass)
           
MapWrapper(Map<?,?> map)
           
 
Method Summary
 Object convertIfNecessary(Object value, Class requiredType, MethodParameter methodParam)
           
protected  Map getMap()
           
 Object getObject()
           
 Class<?> getObjectClass()
           
 Class<?> getPropertyType(String propertyName)
           
 Object getPropertyValue(String propertyName)
           
 boolean isReadableProperty(String propertyName)
           
 boolean isWritableProperty(String propertyName)
           
 void setMapClass(Class<?> mapClass)
           
 void setObject(Object object)
           
 void setPropertyValue(PropertyValue pv)
           
 void setPropertyValue(String propertyName, Object value)
           
 void setPropertyValues(PropertyValues pvs)
           
 void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown)
           
 void setPropertyValues(PropertyValues pvs, boolean ignoreUnknown, boolean ignoreInvalid)
           
 void setValueClass(Class<?> valueClass)
           
 
Methods inherited from class org.springframework.beans.AbstractPropertyAccessor
convertIfNecessary, isExtractOldValueForEditor, setExtractOldValueForEditor, setPropertyValues
 
Methods inherited from class org.springframework.beans.PropertyEditorRegistrySupport
copyCustomEditorsTo, copyDefaultEditorsTo, findCustomEditor, getDefaultEditor, guessPropertyTypeFromEditors, hasCustomEditorForElement, isSharedEditor, registerCustomEditor, registerCustomEditor, registerDefaultEditors, registerSharedEditor, useConfigValueEditors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.beans.ConfigurablePropertyAccessor
isExtractOldValueForEditor, setExtractOldValueForEditor
 
Methods inherited from interface org.springframework.beans.PropertyAccessor
setPropertyValues
 
Methods inherited from interface org.springframework.beans.PropertyEditorRegistry
findCustomEditor, registerCustomEditor, registerCustomEditor
 
Methods inherited from interface org.springframework.beans.TypeConverter
convertIfNecessary
 

Constructor Detail

MapWrapper

public MapWrapper(Map<?,?> map)

MapWrapper

public MapWrapper(Class<?> mapClass)
Method Detail

setMapClass

public void setMapClass(Class<?> mapClass)

setValueClass

public void setValueClass(Class<?> valueClass)

isReadableProperty

public boolean isReadableProperty(String propertyName)
Specified by:
isReadableProperty in interface PropertyAccessor

isWritableProperty

public boolean isWritableProperty(String propertyName)
Specified by:
isWritableProperty in interface PropertyAccessor

getPropertyType

public Class<?> getPropertyType(String propertyName)
Specified by:
getPropertyType in interface PropertyAccessor
Overrides:
getPropertyType in class AbstractPropertyAccessor

setObject

public void setObject(Object object)
Specified by:
setObject in interface ObjectWrapper

getObject

public Object getObject()
Specified by:
getObject in interface ObjectWrapper

getObjectClass

public Class<?> getObjectClass()
Specified by:
getObjectClass in interface ObjectWrapper

getMap

protected Map getMap()

getPropertyValue

public Object getPropertyValue(String propertyName)
Specified by:
getPropertyValue in interface PropertyAccessor
Specified by:
getPropertyValue in class AbstractPropertyAccessor

setPropertyValue

public void setPropertyValue(String propertyName,
                             Object value)
Specified by:
setPropertyValue in interface PropertyAccessor
Specified by:
setPropertyValue in class AbstractPropertyAccessor

setPropertyValue

public void setPropertyValue(PropertyValue pv)
Specified by:
setPropertyValue in interface PropertyAccessor
Overrides:
setPropertyValue in class AbstractPropertyAccessor

setPropertyValues

public void setPropertyValues(PropertyValues pvs,
                              boolean ignoreUnknown,
                              boolean ignoreInvalid)
                       throws BeansException
Specified by:
setPropertyValues in interface PropertyAccessor
Overrides:
setPropertyValues in class AbstractPropertyAccessor
Throws:
BeansException

setPropertyValues

public void setPropertyValues(PropertyValues pvs)
Specified by:
setPropertyValues in interface PropertyAccessor
Overrides:
setPropertyValues in class AbstractPropertyAccessor

setPropertyValues

public void setPropertyValues(PropertyValues pvs,
                              boolean ignoreUnknown)
Specified by:
setPropertyValues in interface PropertyAccessor
Overrides:
setPropertyValues in class AbstractPropertyAccessor

convertIfNecessary

public Object convertIfNecessary(Object value,
                                 Class requiredType,
                                 MethodParameter methodParam)
                          throws TypeMismatchException
Specified by:
convertIfNecessary in interface TypeConverter
Throws:
TypeMismatchException