org.dozer.propertydescriptor
Class MapPropertyDescriptor

java.lang.Object
  extended by org.dozer.propertydescriptor.AbstractPropertyDescriptor
      extended by org.dozer.propertydescriptor.GetterSetterPropertyDescriptor
          extended by org.dozer.propertydescriptor.MapPropertyDescriptor
All Implemented Interfaces:
DozerPropertyDescriptor

public class MapPropertyDescriptor
extends GetterSetterPropertyDescriptor

Internal class used to read and write values for Map backed objects that use key/value pairs. The specified "key" is used when invoking getter/setter. It is assumed that Map setter method has two parameters (for "key" and "value"), but getter method one parameter (for "key"). Overloaded methods are supported. Map class can have two set methods with different signatures, but class will choose the one with appropriate number of parameters.

Only intended for internal use.

Author:
garsombke.franz, tierney.matt, dmitry.buzdin

Field Summary
 
Fields inherited from class org.dozer.propertydescriptor.AbstractPropertyDescriptor
clazz, destDeepIndexHintContainer, fieldName, index, isIndexed, srcDeepIndexHintContainer
 
Constructor Summary
MapPropertyDescriptor(Class<?> clazz, String fieldName, boolean isIndexed, int index, String setMethod, String getMethod, String key, HintContainer srcDeepIndexHintContainer, HintContainer destDeepIndexHintContainer)
           
 
Method Summary
protected  Method getReadMethod()
           
protected  String getSetMethodName()
           
 Method getWriteMethod()
           
protected  Object invokeReadMethod(Object target)
           
protected  void invokeWriteMethod(Object target, Object value)
           
protected  boolean isCustomSetMethod()
           
 void setPropertyValue(Object bean, Object value, FieldMap fieldMap)
           
 
Methods inherited from class org.dozer.propertydescriptor.GetterSetterPropertyDescriptor
genericType, getPropertyType, getPropertyValue, writeDeepDestinationValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapPropertyDescriptor

public MapPropertyDescriptor(Class<?> clazz,
                             String fieldName,
                             boolean isIndexed,
                             int index,
                             String setMethod,
                             String getMethod,
                             String key,
                             HintContainer srcDeepIndexHintContainer,
                             HintContainer destDeepIndexHintContainer)
Method Detail

getWriteMethod

public Method getWriteMethod()
                      throws NoSuchMethodException
Specified by:
getWriteMethod in class GetterSetterPropertyDescriptor
Throws:
NoSuchMethodException

setPropertyValue

public void setPropertyValue(Object bean,
                             Object value,
                             FieldMap fieldMap)
Specified by:
setPropertyValue in interface DozerPropertyDescriptor
Overrides:
setPropertyValue in class GetterSetterPropertyDescriptor

getReadMethod

protected Method getReadMethod()
                        throws NoSuchMethodException
Specified by:
getReadMethod in class GetterSetterPropertyDescriptor
Throws:
NoSuchMethodException

getSetMethodName

protected String getSetMethodName()
                           throws NoSuchMethodException
Specified by:
getSetMethodName in class GetterSetterPropertyDescriptor
Throws:
NoSuchMethodException

isCustomSetMethod

protected boolean isCustomSetMethod()
Specified by:
isCustomSetMethod in class GetterSetterPropertyDescriptor

invokeWriteMethod

protected void invokeWriteMethod(Object target,
                                 Object value)
Overrides:
invokeWriteMethod in class GetterSetterPropertyDescriptor

invokeReadMethod

protected Object invokeReadMethod(Object target)
Overrides:
invokeReadMethod in class GetterSetterPropertyDescriptor


Copyright © 2005-2011 dozer. All Rights Reserved.