org.springframework.binding.mapping.impl
Class DefaultMapper

java.lang.Object
  extended by org.springframework.binding.mapping.impl.DefaultMapper
All Implemented Interfaces:
Mapper

public class DefaultMapper
extends Object
implements Mapper

Generic mapper implementation that allows mappings to be configured programatically.

Author:
Keith Donald
See Also:
addMapping(DefaultMapping)

Constructor Summary
DefaultMapper()
           
 
Method Summary
 DefaultMapper addMapping(DefaultMapping mapping)
          Add a mapping to this mapper.
 Mapping[] getMappings()
          Returns this mapper's list of mappings.
 MappingResults map(Object source, Object target)
          Map state from a source object to a target object.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultMapper

public DefaultMapper()
Method Detail

addMapping

public DefaultMapper addMapping(DefaultMapping mapping)
Add a mapping to this mapper.

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

getMappings

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

Returns:
the list of mappings

map

public MappingResults map(Object source,
                          Object target)
Description copied from interface: Mapper
Map state from a source object to a target object.

Specified by:
map in interface Mapper
Parameters:
source - the source
target - the target
Returns:
results of the mapping transaction

toString

public String toString()
Overrides:
toString in class Object