ma.glasnost.orika.metadata
Class ClassMapBuilderForMaps<A,B>

java.lang.Object
  extended by ma.glasnost.orika.metadata.ClassMapBuilder<A,B>
      extended by ma.glasnost.orika.metadata.ClassMapBuilderForMaps<A,B>
Type Parameters:
A -
B -
All Implemented Interfaces:
MappedTypePair<A,B>
Direct Known Subclasses:
ClassMapBuilderForLists

public class ClassMapBuilderForMaps<A,B>
extends ClassMapBuilder<A,B>

ClassMapBuilderForMaps is a custom ClassMapBuilder instance which is used for mapping standard JavaBeans to Map instances.


Nested Class Summary
static class ClassMapBuilderForMaps.Factory
           
 
Constructor Summary
protected ClassMapBuilderForMaps(Type<A> aType, Type<B> bType, MapperFactory mapperFactory, PropertyResolverStrategy propertyResolver, DefaultFieldMapper... defaults)
           
 
Method Summary
 ClassMapBuilderForMaps<A,B> byDefault(DefaultFieldMapper... withDefaults)
          Configures this class-map builder to employ the default property mapping behavior to any properties that have not already been mapped or excluded; if any DefaultFieldMapper instances are passed, they will be used (instead of those configured on the builder) to attempt a property name match if a direct match is not found.
 FieldMapBuilder<A,B> fieldMap(String fieldNameA, String fieldNameB, boolean byDefault)
          Create a fieldMap for the particular field mapping
protected  String getParentExpression(String epxression)
           
protected  boolean isATypeBean()
           
protected  boolean isSpecialCaseType(Type<?> type)
          Test whether the provided type is the special case type for this Builder (as in, not the standard Java Bean type)
protected  Property resolveCustomProperty(String expr, Type<?> propertyType)
           
protected  Property resolveProperty(Type rawType, String expr)
          Resolves a property for the particular type, based on the provided property expression
protected  ClassMapBuilderForMaps<A,B> self()
           
 
Methods inherited from class ma.glasnost.orika.metadata.ClassMapBuilder
addFieldMap, byDefault, byDefault, constructorA, constructorB, customize, customize, describeClassMap, exclude, field, field, field, field, field, field, field, fieldAToB, fieldBToA, fieldMap, fieldMap, fieldMap, fieldMap, fieldMap, fieldMap, fieldMap, fieldMap, fieldMap, getAType, getBType, getDefaultFieldMappers, getMappedFields, getMappedPropertiesForTypeA, getMappedPropertiesForTypeB, getPropertiesForTypeA, getPropertiesForTypeB, getPropertyResolver, isNestedPropertyExpression, map, map, map, map, mapNulls, mapNullsInReverse, register, resolvePropertyForA, resolvePropertyForB, toClassMap, toString, use, use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassMapBuilderForMaps

protected ClassMapBuilderForMaps(Type<A> aType,
                                 Type<B> bType,
                                 MapperFactory mapperFactory,
                                 PropertyResolverStrategy propertyResolver,
                                 DefaultFieldMapper... defaults)
Parameters:
aType -
bType -
propertyResolver -
defaults -
Method Detail

self

protected ClassMapBuilderForMaps<A,B> self()

isATypeBean

protected boolean isATypeBean()
Returns:
true if the A type for this Builder is the Java Bean type

isSpecialCaseType

protected boolean isSpecialCaseType(Type<?> type)
Test whether the provided type is the special case type for this Builder (as in, not the standard Java Bean type)

Parameters:
type -
Returns:

byDefault

public ClassMapBuilderForMaps<A,B> byDefault(DefaultFieldMapper... withDefaults)
Configures this class-map builder to employ the default property mapping behavior to any properties that have not already been mapped or excluded; if any DefaultFieldMapper instances are passed, they will be used (instead of those configured on the builder) to attempt a property name match if a direct match is not found.

Overrides:
byDefault in class ClassMapBuilder<A,B>
Parameters:
withDefaults - zero or more DefaultFieldMapper instances to apply during the default mapping; if none are supplied, the configured DefaultFieldMappers for the builder (if any) should be used.
Returns:
this ClassMapBuilder instance

getParentExpression

protected String getParentExpression(String epxression)

fieldMap

public FieldMapBuilder<A,B> fieldMap(String fieldNameA,
                                     String fieldNameB,
                                     boolean byDefault)
Description copied from class: ClassMapBuilder
Create a fieldMap for the particular field mapping

Overrides:
fieldMap in class ClassMapBuilder<A,B>
Parameters:
fieldNameA - the name of the field in type A
fieldNameB - the name of the field in type B
byDefault - whether the field mapping has been provided by default
Returns:

resolveProperty

protected Property resolveProperty(Type rawType,
                                   String expr)
Resolves a property for the particular type, based on the provided property expression

Overrides:
resolveProperty in class ClassMapBuilder<A,B>
Parameters:
rawType - the type to resolve
expr - the property expression to resolve
Returns:

resolveCustomProperty

protected Property resolveCustomProperty(String expr,
                                         Type<?> propertyType)


Copyright © 2013 Glasnost. All Rights Reserved.