org.springframework.binding.mapping
Class Mapping

java.lang.Object
  extended by org.springframework.binding.mapping.Mapping
All Implemented Interfaces:
AttributeMapper
Direct Known Subclasses:
RequiredMapping

public class Mapping
extends java.lang.Object
implements AttributeMapper

A single mapping definition, encapulating the information neccessary to map the result of evaluating an expression on a source object to a property on a target object, optionally applying a type conversion during the mapping process.

Author:
Keith Donald

Constructor Summary
  Mapping(Expression sourceExpression, SettableExpression targetExpression, ConversionExecutor typeConverter)
          Creates a new mapping.
protected Mapping(Expression sourceExpression, SettableExpression targetExpression, ConversionExecutor typeConverter, boolean required)
          Creates a new mapping.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 void map(java.lang.Object source, java.lang.Object target, MappingContext context)
          Map the sourceAttribute in to the targetAttribute target map, performing type conversion if necessary.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Mapping

public Mapping(Expression sourceExpression,
               SettableExpression targetExpression,
               ConversionExecutor typeConverter)
Creates a new mapping.

Parameters:
sourceExpression - the source expression
targetExpression - the target expression
typeConverter - a type converter

Mapping

protected Mapping(Expression sourceExpression,
                  SettableExpression targetExpression,
                  ConversionExecutor typeConverter,
                  boolean required)
Creates a new mapping.

Parameters:
sourceExpression - the source expression
targetExpression - the target expression
typeConverter - a type converter
required - whether or not this mapping is required
Method Detail

map

public void map(java.lang.Object source,
                java.lang.Object target,
                MappingContext context)
Map the sourceAttribute in to the targetAttribute target map, performing type conversion if necessary.

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

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

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


Copyright © 2009 Spring Framework. All Rights Reserved.