|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MapperFactory
MapperFactory is used to both configure, register, and generate the underlying Mapper and Converter instances which will be used to perform the the mapping functions.
| Method Summary | ||
|---|---|---|
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(). |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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 |
|
|
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()
|
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
lookupMapper(MapperKey mapperKey)
Get the Mapper (if any) which has been associated with the given MapperKey. |
|
|
lookupObjectFactory(Type<T> targetType)
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 |
|
|
registerClassMap(ClassMap<A,B> classMap)
Registers the given ClassMap instance with the factory; it will be used to configure an appropriate mapping. |
|
|
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. |
|
|
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. |
|
|
registerObjectFactory(ObjectFactory<T> objectFactory,
Class<T> targetClass)
Deprecated. use registerObjectFactory(ObjectFactory, Type)
instead. |
|
|
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. |
|
| Method Detail |
|---|
<A,B> Mapper<A,B> lookupMapper(MapperKey mapperKey)
mapperKey - the MapperKey for which to look up an associated Mapper
mapperKey;
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 registertargetType - 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> ObjectFactory<T> lookupObjectFactory(Type<T> targetType)
targetType - the type for which to lookup a registered ObjectFactory.
null 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 - allowAutoGeneratedMappers - context -
@Deprecated void registerMappingHint(MappingHint... hints)
void registerDefaultFieldMapper(DefaultFieldMapper... fieldDefaults)
fieldDefaults - one or more DefaultFieldMapper instances to register
void registerConcreteType(Type<?> abstractType,
Type<?> concreteType)
abstractType - the type of the abstract class or interfaceconcreteType - the concrete type to instantiate
void 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
ClassMap
null 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 types
MapperFacade 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; if 'false', an optimized
DedicatedMapperFacade instance can be provided.
<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 graph; if 'false', an optimized
DedicatedMapperFacade instance can be provided.
ConverterFactory getConverterFactory()
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 mapping
UnenhanceStrategy getUserUnenhanceStrategy()
UnenhanceStrategy associated with this MapperFactory,
provided when this MapperFactory was constructed.
UnenhanceStrategy associated with this MapperFactory.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||