public interface MapperFactory
| Modifier and Type | Method and Description |
|---|---|
void |
build()
Deprecated.
this method no longer needs to be called by clients; the
MapperFactory instances should automatically be built upon
the first call to
getMapperFacade(). |
<A,B> ClassMapBuilder<A,B> |
classMap(Class<A> aType,
Class<B> bType)
Constructs a new ClassMapBuilder instance initialized with the provided
types which can be used to configure/customize the mapping between the
two types.
The returned ClassMapBuilder instance, after being fully configured, should finally be registered with the factory using the registerClassMap method. |
<A,B> ClassMapBuilder<A,B> |
classMap(Class<A> aType,
Type<B> bType)
Constructs a new ClassMapBuilder instance initialized with the provided
types which can be used to configure/customize the mapping between the
two types.
The returned ClassMapBuilder instance, after being fully configured, should finally be registered with the factory using the registerClassMap method. |
<A,B> ClassMapBuilder<A,B> |
classMap(Type<A> aType,
Class<B> bType)
Constructs a new ClassMapBuilder instance initialized with the provided
types which can be used to configure/customize the mapping between the
two types.
The returned ClassMapBuilder instance, after being fully configured, should finally be registered with the factory using the registerClassMap method. |
<A,B> ClassMapBuilder<A,B> |
classMap(Type<A> aType,
Type<B> bType)
Constructs a new ClassMapBuilder instance initialized with the provided
types which can be used to configure/customize the mapping between the
two types.
The returned ClassMapBuilder instance, after being fully configured, should finally be registered with the factory using the registerClassMap method. |
boolean |
existsRegisteredMapper(Type<?> sourceType,
Type<?> destinationType,
boolean includeAutoGeneratedMappers)
Tests for the existence of a registered mapper which corresponds to the
supplied mapperKey
|
<A,B> ClassMap<A,B> |
getClassMap(MapperKey mapperKey)
Gets the ClassMap instance (if any) which has been associated with the
types represented by the given MapperKey instance.
|
ConverterFactory |
getConverterFactory()
Get an instance of the ConverterFactory associated with this
MapperFactory; it may be used to register Converter instances to be used
during mapping.
|
MapperFacade |
getMapperFacade() |
<A,B> BoundMapperFacade<A,B> |
getMapperFacade(Class<A> aType,
Class<B> bType)
Returns a BoundMapperFacade for the specified source and destination
types; this mapper is bidirectional by default, and provides signatures for
mapping in place, or with instantiation, as needed.
|
<A,B> BoundMapperFacade<A,B> |
getMapperFacade(Class<A> aType,
Class<B> bType,
boolean containsCycles)
Returns a BoundMapperFacade for the specified source and destination
types; this mapper is bidirectional by default, and provides signatures for
mapping in place, or with instantiation, as needed.
In the case that false is provided for the 'containsCycles' parameter,
an optimized mapper instance will be provided. |
<A,B> BoundMapperFacade<A,B> |
getMapperFacade(Type<A> aType,
Type<B> bType)
Returns a BoundMapperFacade for the specified source and destination
types; this mapper is bidirectional by default, and provides signatures for
mapping in place, or with instantiation, as needed.
|
<A,B> BoundMapperFacade<A,B> |
getMapperFacade(Type<A> aType,
Type<B> bType,
boolean containsCycles)
Returns a BoundMapperFacade for the specified source and destination
types; this mapper is bidirectional by default, and provides signatures for
mapping in place, or with instantiation, as needed.
In the case that false is provided for the 'containsCycles' parameter,
an optimized mapper instance will be provided. |
UnenhanceStrategy |
getUserUnenhanceStrategy()
Returns the
UnenhanceStrategy associated with this MapperFactory,
provided when this MapperFactory was constructed. |
<S,D> Type<? extends D> |
lookupConcreteDestinationType(Type<S> sourceType,
Type<D> destinationType,
MappingContext context) |
Set<Type<? extends Object>> |
lookupMappedClasses(Type<?> type)
Get the set of classes which have been mapped for the specified type.
|
<A,B> Mapper<A,B> |
lookupMapper(MapperKey mapperKey)
Get the Mapper (if any) which has been associated with the given
MapperKey.
|
<A,B> Mapper<A,B> |
lookupMapper(MapperKey mapperKey,
MappingContext context)
Get the Mapper (if any) which has been associated with the given
MapperKey.
|
<T> ObjectFactory<T> |
lookupObjectFactory(Type<T> targetType)
Deprecated.
use
lookupObjectFactory(Type, Type) instead |
<T,S> ObjectFactory<T> |
lookupObjectFactory(Type<T> targetType,
Type<S> sourceType)
Return the object factory (if any) which has been registered for the
given type.
|
<T,S> ObjectFactory<T> |
lookupObjectFactory(Type<T> targetType,
Type<S> sourceType,
MappingContext context)
Return the object factory (if any) which has been registered for the
given type.
|
Set<ClassMap<Object,Object>> |
lookupUsedClassMap(MapperKey mapperKey)
Lookup the class map hierarchy used for the mapping defined by the
specified MapperKey, if any exists
|
<A,B> void |
registerClassMap(ClassMap<A,B> classMap)
Registers the given ClassMap instance with the factory; it will be used
to configure an appropriate mapping.
|
<A,B> void |
registerClassMap(ClassMapBuilder<A,B> builder)
Registers the ClassMap configured by the specified ClassMapBuilder; it
will be used to configure an appropriate mapping.
|
void |
registerConcreteType(Class<?> abstractType,
Class<?> concreteType)
Register a concrete type to use when a need arises to generate a new
instance of a given abstract type (abstract class or interface)
|
void |
registerConcreteType(Type<?> abstractType,
Type<?> concreteType)
Register a concrete type to use when a need arises to generate a new
instance of a given abstract type (abstract class or interface)
|
void |
registerDefaultFieldMapper(DefaultFieldMapper... fieldDefaults)
Register one or more DefaultFieldMapper instances to be used by this
MapperFactory; these instances will be used whenever automatically
generating a Mapper for a given pair of types.
|
void |
registerFilter(Filter<?,?> filter)
Registers a filter to be applied in the mapping process; such filters may
be used to alter source and destination values of the fields as they
are processed by mappers.
|
<A,B> void |
registerMapper(Mapper<A,B> mapper)
Registers the specified custom mapper with the factory; it will be used
for mapping between it's configured types.
|
void |
registerMappingHint(MappingHint... hints)
Deprecated.
|
<T> void |
registerObjectFactory(ObjectFactory<T> objectFactory,
Class<T> targetClass)
Deprecated.
use
registerObjectFactory(ObjectFactory, Type)
instead. |
<T> void |
registerObjectFactory(ObjectFactory<T> objectFactory,
Type<T> targetType)
Register the given ObjectFactory with the MapperFactory; it will be used
when constructing new instances of the specified targetType.
|
<T,S> void |
registerObjectFactory(ObjectFactory<T> objectFactory,
Type<T> targetType,
Type<S> sourceType)
Register the given ObjectFactory with the MapperFactory; it will be used
when constructing new instances of the specified targetType when it is
being mapped from the specified source type.
|
<A,B> Mapper<A,B> lookupMapper(MapperKey mapperKey)
mapperKey - the MapperKey for which to look up an associated MappermapperKey;<A,B> Mapper<A,B> lookupMapper(MapperKey mapperKey, MappingContext context)
mapperKey - the MapperKey for which to look up an associated Mappercontext - the current mapping contextmapperKey;boolean existsRegisteredMapper(Type<?> sourceType, Type<?> destinationType, boolean includeAutoGeneratedMappers)
sourceType - the source typedestinationType - the destination typeincludeAutoGeneratedMappers - specifies whether an auto-generated mapper for the given
source and destination type should be considered<A,B> void registerMapper(Mapper<A,B> mapper)
mapper - the mapper to register<A,B> void registerClassMap(ClassMap<A,B> classMap)
classMap - the ClassMap instance to register<A,B> void registerClassMap(ClassMapBuilder<A,B> builder)
builder - the ClassMapBuilder to register@Deprecated <T> void registerObjectFactory(ObjectFactory<T> objectFactory, Class<T> targetClass)
registerObjectFactory(ObjectFactory, Type)
instead.objectFactory - the object factory to registertargetClass - the type which is generated by the given object factory<T> void registerObjectFactory(ObjectFactory<T> objectFactory, Type<T> targetType)
objectFactory - the object factory to registertargetType - the type which is generated by the given object factory<T,S> void registerObjectFactory(ObjectFactory<T> objectFactory, Type<T> targetType, Type<S> sourceType)
objectFactory - the object factory to registertargetType - the type which is generated by the given object factorysourceType - the source type from which the destination type is mapped@Deprecated <T> ObjectFactory<T> lookupObjectFactory(Type<T> targetType)
lookupObjectFactory(Type, Type) insteadtargetType - the type for which to lookup a registered ObjectFactory.null if no ObjectFactory has been registered for the
given type.<T,S> ObjectFactory<T> lookupObjectFactory(Type<T> targetType, Type<S> sourceType)
targetType - the type for which to lookup a registered ObjectFactory.sourceType - the source type from which the target is mappednull if no ObjectFactory has been registered for the
given type.<T,S> ObjectFactory<T> lookupObjectFactory(Type<T> targetType, Type<S> sourceType, MappingContext context)
targetType - the type for which to lookup a registered ObjectFactory.sourceType - the source type from which the target is mappedcontext - the current mapping contextnull if no ObjectFactory has been registered for the
given type.<S,D> Type<? extends D> lookupConcreteDestinationType(Type<S> sourceType, Type<D> destinationType, MappingContext context)
sourceType - destinationType - context - @Deprecated void registerMappingHint(MappingHint... hints)
hints - void registerDefaultFieldMapper(DefaultFieldMapper... fieldDefaults)
fieldDefaults - one or more DefaultFieldMapper instances to registervoid registerConcreteType(Type<?> abstractType, Type<?> concreteType)
abstractType - the type of the abstract class or interfaceconcreteType - the concrete type to instantiatevoid registerConcreteType(Class<?> abstractType, Class<?> concreteType)
abstractType - the abstract class or interfaceconcreteType - the concrete class to instantiateSet<ClassMap<Object,Object>> lookupUsedClassMap(MapperKey mapperKey)
mapperKey - the mapper key defining the mapping to resolve<A,B> ClassMap<A,B> getClassMap(MapperKey mapperKey)
mapperKey - the MapperKey which should be used to look up an associated
ClassMapnull if no instance has been associated with this
MapperKey instance.Set<Type<? extends Object>> lookupMappedClasses(Type<?> type)
type - the type for which to look up mapped typesMapperFacade getMapperFacade()
<A,B> BoundMapperFacade<A,B> getMapperFacade(Type<A> aType, Type<B> bType)
aType - the 'A' type for the returned DedicatedMapperFacadebType - the 'B' type for the returned DedicatedMapperFacade<A,B> BoundMapperFacade<A,B> getMapperFacade(Class<A> aType, Class<B> bType)
aType - the 'A' type for the returned DedicatedMapperFacadebType - the 'B' type for the returned DedicatedMapperFacade<A,B> BoundMapperFacade<A,B> getMapperFacade(Type<A> aType, Type<B> bType, boolean containsCycles)
false is provided for the 'containsCycles' parameter,
an optimized mapper instance will be provided.aType - the 'A' type for the returned DedicatedMapperFacadebType - the 'B' type for the returned DedicatedMapperFacadecontainsCycles - true if the object graph for the source and destination types
may contain cycles in it's graph<A,B> BoundMapperFacade<A,B> getMapperFacade(Class<A> aType, Class<B> bType, boolean containsCycles)
false is provided for the 'containsCycles' parameter,
an optimized mapper instance will be provided.aType - the 'A' type for the returned DedicatedMapperFacadebType - the 'B' type for the returned DedicatedMapperFacadecontainsCycles - true if the object graph for the source and destination types
may contain cycles in it's graphConverterFactory getConverterFactory()
@Deprecated void build()
getMapperFacade().<A,B> ClassMapBuilder<A,B> classMap(Type<A> aType, Type<B> bType)
registerClassMap method.aType - the Type instance representing the "A" side of the mappingbType - the Type instance representing the "B" side of the mapping<A,B> ClassMapBuilder<A,B> classMap(Class<A> aType, Type<B> bType)
registerClassMap method.aType - the Class instance representing the "A" side of the mappingbType - the Type instance representing the "B" side of the mapping<A,B> ClassMapBuilder<A,B> classMap(Type<A> aType, Class<B> bType)
registerClassMap method.aType - the Type instance representing the "A" side of the mappingbType - the Class instance representing the "B" side of the mapping<A,B> ClassMapBuilder<A,B> classMap(Class<A> aType, Class<B> bType)
registerClassMap method.aType - the Class instance representing the "A" side of the mappingbType - the Class instance representing the "B" side of the mappingUnenhanceStrategy getUserUnenhanceStrategy()
UnenhanceStrategy associated with this MapperFactory,
provided when this MapperFactory was constructed.UnenhanceStrategy associated with this MapperFactory.void registerFilter(Filter<?,?> filter)
filter - the filter to be registeredCopyright © 2017 Glasnost. All Rights Reserved.