org.jbeanmapper
Class DefaultPropertyMapper

java.lang.Object
  extended byorg.jbeanmapper.DefaultPropertyMapper
All Implemented Interfaces:
PropertyMapper

public class DefaultPropertyMapper
extends java.lang.Object
implements PropertyMapper

PropertyMapper to handle basic beans. Supports nested properties in for target object.

Author:
Brian Pugh

Constructor Summary
DefaultPropertyMapper()
           
 
Method Summary
 void mapProperty(java.lang.Object srcObject, java.lang.String srcProperty, java.lang.Object targetObject, java.lang.String targetProperty, MappingContext context, BeanConverter converter)
          Map srcObject's srcProperty to targetObjects' targetProperty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPropertyMapper

public DefaultPropertyMapper()
Method Detail

mapProperty

public void mapProperty(java.lang.Object srcObject,
                        java.lang.String srcProperty,
                        java.lang.Object targetObject,
                        java.lang.String targetProperty,
                        MappingContext context,
                        BeanConverter converter)
                 throws PropertyMappingException,
                        BeanMappingException
Map srcObject's srcProperty to targetObjects' targetProperty. TargetProerty can be a hierarchy of nested beans using a "." to indicate beans. For example a targetProperty value of person.fullName.name.text indicates that the srcProperty should be mapped to text property of the name property of the fullName property of the person property of targetObject.

Specified by:
mapProperty in interface PropertyMapper
Parameters:
srcObject - an instance of the source object.
srcProperty - the property to be mapped.
targetObject - an isntance of the target object.
targetProperty - the target object's property that should be mapped.
context - the mapping context.
converter - the converter to use in the mapping.
Throws:
PropertyMappingException - if property mapping fails.
BeanMappingException - if a bean mapping fails.