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
InheritInverseConfiguration, or automatically in case all source and target
types are assignable.
|Modifier and Type||Optional Element and Description|
The strategy to be applied when propagating the value of collection-typed properties.
Specifies the component model to which the generated mapper should adhere.
If MapStruct could not find another mapping method or apply an automatic conversion it will try to generate a sub-mapping method between the two beans.
Specifies the name of the implementation class.
Specifies the target package for the generated implementation.
The strategy to use for applying method-level configuration annotations of prototype methods in the interface annotated with this annotation.
Determines when to include a null check on the source property value of a bean mapping.
The strategy to be applied when
How unmapped properties of the target type of a mapping should be reported.
The mapper types used by this mapper.
public abstract Class<?> uses
public abstract ReportingPolicy unmappedTargetPolicy
public abstract String componentModel
default: the mapper uses no component model, instances are typically retrieved via
cdi: the generated mapper is an application-scoped CDI bean and can be retrieved via
spring: the generated mapper is a Spring bean and can be retrieved via
jsr330: the generated mapper is annotated with
@Singleton, and can be retrieved via
public abstract String implementationName
<CLASS_NAME>will be replaced by the interface/abstract class name.
Defaults to postfixing the name with
public abstract String implementationPackage
<PACKAGE_NAME>will be replaced by the interface's or abstract class' package.
Defaults to using the same package as the mapper interface/abstract class
public abstract CollectionMappingStrategy collectionMappingStrategy
public abstract NullValueMappingStrategy nullValueMappingStrategy
nullis passed as source value to mapping methods. If no strategy is configured,
NullValueMappingStrategy.RETURN_NULLwill be used by default.
nullis passed as source value to mapping methods.
public abstract MappingInheritanceStrategy mappingInheritanceStrategy
If no strategy is configured,
MappingInheritanceStrategy.EXPLICIT will be used as default.
@Mappingconfigurations of prototype methods in the interface annotated with this annotation.
public abstract NullValueCheckStrategy nullValueCheckStrategy
public abstract boolean disableSubMappingMethodsGeneration
trueMapStruct will not try to automatically generate sub-mapping methods.
Can be overridden by
Note: If you need to use
disableSubMappingMethodsGeneration please contact the MapStruct team at
github.com/mapstruct/mapstruct to share what problem you
are facing with the automatic sub-mapping generation.
Copyright © 2012-2017 Gunnar Morling; All rights reserved. Released under the Apache Software License 2.0.