@Target(value=TYPE)
@Retention(value=CLASS)
public @interface MapperConfig
Generally, any settings given via Mapper take precedence over the settings given via the referenced
MapperConfig. The lists of referenced mappers given via Mapper.uses() and
uses() will be merged.
Additionally, mapper configuration classes may declare one more prototype mapping methods. These methods are
not meant to be invoked themselves (no implementation will generated for mapper config classes), but serve as
configuration template for mapping methods declared by actual mapper classes. Depending on the configured
mappingInheritanceStrategy(), the configuration can be inherited either explicitly using
InheritConfiguration or InheritInverseConfiguration, or automatically in case all source and target
types are assignable.
Mapper.config()| Modifier and Type | Optional Element and Description |
|---|---|
CollectionMappingStrategy |
collectionMappingStrategy
The strategy to be applied when propagating the value of collection-typed properties.
|
java.lang.String |
componentModel
Specifies the component model to which the generated mapper should
adhere.
|
MappingInheritanceStrategy |
mappingInheritanceStrategy
The strategy to use for applying method-level configuration annotations of prototype methods in the interface
annotated with this annotation.
|
NullValueMappingStrategy |
nullValueMappingStrategy
The strategy to be applied when
null is passed as source value to mapping methods. |
ReportingPolicy |
unmappedTargetPolicy
How unmapped properties of the target type of a mapping should be
reported.
|
java.lang.Class<?>[] |
uses
The mapper types used by this mapper.
|
public abstract java.lang.Class<?>[] uses
public abstract ReportingPolicy unmappedTargetPolicy
public abstract java.lang.String componentModel
default: the mapper uses no component model, instances are
typically retrieved via Mappers.getMapper(Class)cdi: the generated mapper is an application-scoped CDI bean and
can be retrieved via @Injectspring: the generated mapper is a Spring bean and
can be retrieved via @Autowiredjsr330: the generated mapper is annotated with @Named and
can be retrieved via @Injectpublic abstract CollectionMappingStrategy collectionMappingStrategy
orderDto.addOrderLine()).public abstract NullValueMappingStrategy nullValueMappingStrategy
null is passed as source value to mapping methods. If no strategy is
configured, NullValueMappingStrategy.RETURN_NULL will be used by default.null is passed as source value to mapping methods.public abstract MappingInheritanceStrategy mappingInheritanceStrategy
Mapping,
IterableMapping, MapMapping, or BeanMapping.
If no strategy is configured, MappingInheritanceStrategy.EXPLICIT will be used as default.
@Mapping configurations of prototype methods in the interface
annotated with this annotation.Copyright © 2012-2015. All Rights Reserved.