ma.glasnost.orika.metadata
Class ClassMapBuilderFactory

java.lang.Object
  extended by ma.glasnost.orika.metadata.ClassMapBuilderFactory
Direct Known Subclasses:
CaseInsensitiveClassMapBuilder.Factory, ClassMapBuilder.Factory, ClassMapBuilderForArrays.Factory, ClassMapBuilderForLists.Factory, ClassMapBuilderForMaps.Factory, ScoringClassMapBuilder.Factory

public abstract class ClassMapBuilderFactory
extends Object

ClassMapBuilderFactory should be used to construct the new instances of ClassMapBuilder needed to register a mapping from one class/type to another class/type.

Author:
matt.deboer@gmail.com

Field Summary
protected  ClassMapBuilderFactory chainClassMapBuilderFactory
           
protected  DefaultFieldMapper[] defaults
           
protected  MapperFactory mapperFactory
           
protected  PropertyResolverStrategy propertyResolver
           
 
Constructor Summary
ClassMapBuilderFactory()
           
 
Method Summary
protected
<A,B> boolean
applied(Type<A> aType, Type<B> bType)
          Return true if this implementation of factory is suitable for received types
<A,B> ClassMapBuilderFactory
choiceClassMapBuilderFactory(Type<A> aType, Type<B> bType)
          Choice suitable ClassMapBuilderFactory for types from factories chain
 boolean isInitialized()
          Verifies whether the factory has been properly initialized
<A,B> ClassMapBuilder<A,B>
map(Class<A> aType, Class<B> bType)
          Begin a new mapping for the specified classes.
<A,B> ClassMapBuilder<A,B>
map(Class<A> aType, Type<B> bType)
          Begin a new mapping for the specified class and type.
<A,B> ClassMapBuilder<A,B>
map(Type<A> aType, Class<B> bType)
          Begin a new mapping for the specified type and class.
<A,B> ClassMapBuilder<A,B>
map(Type<A> aType, Type<B> bType)
          Begin a new mapping for the specified types.
protected abstract
<A,B> ClassMapBuilder<A,B>
newClassMapBuilder(Type<A> aType, Type<B> bType, MapperFactory mapperFactory, PropertyResolverStrategy propertyResolver, DefaultFieldMapper[] defaults)
          Generates a new ClassMapBuilder instance
 void setChainClassMapBuilderFactory(ClassMapBuilderFactory classMapBuilderFactory)
           
 void setDefaultFieldMappers(DefaultFieldMapper... defaults)
           
 void setMapperFactory(MapperFactory mapperFactory)
           
 void setPropertyResolver(PropertyResolverStrategy propertyResolver)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chainClassMapBuilderFactory

protected ClassMapBuilderFactory chainClassMapBuilderFactory

mapperFactory

protected MapperFactory mapperFactory

propertyResolver

protected PropertyResolverStrategy propertyResolver

defaults

protected DefaultFieldMapper[] defaults
Constructor Detail

ClassMapBuilderFactory

public ClassMapBuilderFactory()
Method Detail

setMapperFactory

public void setMapperFactory(MapperFactory mapperFactory)
Parameters:
mapperFactory - the MapperFactory which will be used to register the ClassMapBuilder instances via their 'register()' method

applied

protected <A,B> boolean applied(Type<A> aType,
                                Type<B> bType)
Return true if this implementation of factory is suitable for received types

Parameters:
aType -
bType -
Returns:

setChainClassMapBuilderFactory

public void setChainClassMapBuilderFactory(ClassMapBuilderFactory classMapBuilderFactory)

choiceClassMapBuilderFactory

public <A,B> ClassMapBuilderFactory choiceClassMapBuilderFactory(Type<A> aType,
                                                                 Type<B> bType)
Choice suitable ClassMapBuilderFactory for types from factories chain

Type Parameters:
A -
B -
Parameters:
aType -
bType -
Returns:

setPropertyResolver

public void setPropertyResolver(PropertyResolverStrategy propertyResolver)
Parameters:
propertyResolver - the PropertyResolverStrategy instance to use when resolving properties of the mapped types

setDefaultFieldMappers

public void setDefaultFieldMappers(DefaultFieldMapper... defaults)
Parameters:
defaults - zero or more DefaultFieldMapper instances that should be applied when the byDefault method of the ClassMapBuilder is called.

isInitialized

public boolean isInitialized()
Verifies whether the factory has been properly initialized

Returns:
true if the factory has been initialized

newClassMapBuilder

protected abstract <A,B> ClassMapBuilder<A,B> newClassMapBuilder(Type<A> aType,
                                                                 Type<B> bType,
                                                                 MapperFactory mapperFactory,
                                                                 PropertyResolverStrategy propertyResolver,
                                                                 DefaultFieldMapper[] defaults)
Generates a new ClassMapBuilder instance

Parameters:
aType -
bType -
Returns:
a new ClassMapBuilder for the provided types

map

public <A,B> ClassMapBuilder<A,B> map(Type<A> aType,
                                      Type<B> bType)
Begin a new mapping for the specified types.

Parameters:
aType -
bType -
Returns:
a new ClassMapBuilder instance for the specified types

map

public <A,B> ClassMapBuilder<A,B> map(Class<A> aType,
                                      Type<B> bType)
Begin a new mapping for the specified class and type.

Parameters:
aType -
bType -
Returns:
a new ClassMapBuilder instance for the specified types

map

public <A,B> ClassMapBuilder<A,B> map(Type<A> aType,
                                      Class<B> bType)
Begin a new mapping for the specified type and class.

Parameters:
aType -
bType -
Returns:
a new ClassMapBuilder instance for the specified types

map

public <A,B> ClassMapBuilder<A,B> map(Class<A> aType,
                                      Class<B> bType)
Begin a new mapping for the specified classes.

Parameters:
aType -
bType -
Returns:
a new ClassMapBuilder instance for the specified types


Copyright © 2013 Glasnost. All Rights Reserved.