Class MapPropertyDescriptor
- java.lang.Object
-
- com.github.dozermapper.core.propertydescriptor.AbstractPropertyDescriptor
-
- com.github.dozermapper.core.propertydescriptor.GetterSetterPropertyDescriptor
-
- com.github.dozermapper.core.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.
-
-
Field Summary
-
Fields inherited from class com.github.dozermapper.core.propertydescriptor.GetterSetterPropertyDescriptor
beanContainer, destBeanCreator
-
Fields inherited from class com.github.dozermapper.core.propertydescriptor.AbstractPropertyDescriptor
clazz, destDeepIndexHintContainer, fieldName, index, isIndexed, srcDeepIndexHintContainer
-
-
Constructor Summary
Constructors Constructor Description MapPropertyDescriptor(Class<?> clazz, String fieldName, boolean isIndexed, int index, String setMethod, String getMethod, String key, HintContainer srcDeepIndexHintContainer, HintContainer destDeepIndexHintContainer, BeanContainer beanContainer, DestBeanCreator destBeanCreator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MethodgetReadMethod()protected StringgetSetMethodName()MethodgetWriteMethod()protected ObjectinvokeReadMethod(Object target)protected voidinvokeWriteMethod(Object target, Object value)protected booleanisCustomSetMethod()voidsetPropertyValue(Object bean, Object value, FieldMap fieldMap)-
Methods inherited from class com.github.dozermapper.core.propertydescriptor.GetterSetterPropertyDescriptor
genericType, getPropertyType, getPropertyValue, getWriteMethodPropertyType, writeDeepDestinationValue
-
-
-
-
Constructor Detail
-
MapPropertyDescriptor
public MapPropertyDescriptor(Class<?> clazz, String fieldName, boolean isIndexed, int index, String setMethod, String getMethod, String key, HintContainer srcDeepIndexHintContainer, HintContainer destDeepIndexHintContainer, BeanContainer beanContainer, DestBeanCreator destBeanCreator)
-
-
Method Detail
-
getWriteMethod
public Method getWriteMethod()
- Specified by:
getWriteMethodin classGetterSetterPropertyDescriptor
-
setPropertyValue
public void setPropertyValue(Object bean, Object value, FieldMap fieldMap)
- Specified by:
setPropertyValuein interfaceDozerPropertyDescriptor- Overrides:
setPropertyValuein classGetterSetterPropertyDescriptor
-
getReadMethod
protected Method getReadMethod()
- Specified by:
getReadMethodin classGetterSetterPropertyDescriptor
-
getSetMethodName
protected String getSetMethodName()
- Specified by:
getSetMethodNamein classGetterSetterPropertyDescriptor
-
isCustomSetMethod
protected boolean isCustomSetMethod()
- Specified by:
isCustomSetMethodin classGetterSetterPropertyDescriptor
-
invokeWriteMethod
protected void invokeWriteMethod(Object target, Object value)
- Overrides:
invokeWriteMethodin classGetterSetterPropertyDescriptor
-
invokeReadMethod
protected Object invokeReadMethod(Object target)
- Overrides:
invokeReadMethodin classGetterSetterPropertyDescriptor
-
-