org.springframework.binding.mapping
Class DefaultAttributeMapper

java.lang.Object
  extended by org.springframework.binding.mapping.DefaultAttributeMapper
All Implemented Interfaces:
AttributeMapper

public class DefaultAttributeMapper
extends java.lang.Object
implements AttributeMapper

Generic attributes mapper implementation that allows mappings to be configured programatically.

Author:
Erwin Vervaet, Keith Donald, Colin Sampaleanu

Constructor Summary
DefaultAttributeMapper()
           
 
Method Summary
 DefaultAttributeMapper addMapping(AttributeMapper mapping)
          Add a mapping to this mapper.
 void addMappings(AttributeMapper[] mappings)
          Add a set of mappings.
 AttributeMapper[] getMappings()
          Returns this mapper's list of mappings.
 void map(java.lang.Object source, java.lang.Object target, MappingContext context)
          Map data from a source object to a target object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultAttributeMapper

public DefaultAttributeMapper()
Method Detail

addMapping

public DefaultAttributeMapper addMapping(AttributeMapper mapping)
Add a mapping to this mapper.

Parameters:
mapping - the mapping to add (as an AttributeMapper)
Returns:
this, to support convenient call chaining

addMappings

public void addMappings(AttributeMapper[] mappings)
Add a set of mappings.

Parameters:
mappings - the mappings

getMappings

public AttributeMapper[] getMappings()
Returns this mapper's list of mappings.

Returns:
the list of mappings

map

public void map(java.lang.Object source,
                java.lang.Object target,
                MappingContext context)
Description copied from interface: AttributeMapper
Map data from a source object to a target object.

Specified by:
map in interface AttributeMapper
Parameters:
source - the source
target - the target
context - the mapping context

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright � 2004-2007. All Rights Reserved.