
| Modifier and Type | Optional Element and Description |
|---|---|
CollectionMappingStrategy |
collectionMappingStrategy
The strategy to be applied when propagating the value of collection-typed properties.
|
String |
componentModel
Specifies the component model to which the generated mapper should
adhere.
|
Class<?> |
config
A class annotated with
MapperConfig which should be used as configuration template. |
boolean |
disableSubMappingMethodsGeneration
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.
|
String |
implementationName
Specifies the name of the implementation class.
|
String |
implementationPackage
Specifies the target package for the generated implementation.
|
Class<?>[] |
imports
Additional types for which an import statement is to be added to the generated mapper implementation class.
|
MappingInheritanceStrategy |
mappingInheritanceStrategy
The strategy to use for applying method-level configuration annotations of prototype methods in the interface
specified with
config(). |
NullValueCheckStrategy |
nullValueCheckStrategy
Determines when to include a null check on the source property value of a bean mapping.
|
NullValueMappingStrategy |
nullValueMappingStrategy
The strategy to be applied when
null is passed as source value to the methods of this mapper. |
ReportingPolicy |
unmappedTargetPolicy
How unmapped properties of the target type of a mapping should be
reported.
|
Class<?>[] |
uses
Other mapper types used by this mapper.
|
public abstract Class<?>[] uses
public abstract Class<?>[] imports
Mapping.expression() using
their simple name rather than their fully-qualified name.public abstract ReportingPolicy unmappedTargetPolicy
config()public abstract 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 @javax.inject.Named and
@Singleton, and can be retrieved via @Injectconfig()public abstract String implementationName
<CLASS_NAME> will be replaced by the
interface/abstract class name.
Defaults to postfixing the name with Impl: <CLASS_NAME>Impl
implementationPackage()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
implementationName()public abstract Class<?> config
MapperConfig which should be used as configuration template. Any settings given
via Mapper will take precedence over the settings from the referenced configuration source. The list of
referenced mappers will contain all mappers given via uses() and MapperConfig.uses().public abstract CollectionMappingStrategy collectionMappingStrategy
orderDto.addOrderLine()).
Any setting given for this attribute will take precedence over MapperConfig.collectionMappingStrategy(),
if present.
public abstract NullValueMappingStrategy nullValueMappingStrategy
null is passed as source value to the methods of this mapper. If no
strategy is configured, the strategy given via MapperConfig.nullValueMappingStrategy() will be applied,
using NullValueMappingStrategy.RETURN_NULL by default.null is passed as source value to the methods of this mapper.public abstract MappingInheritanceStrategy mappingInheritanceStrategy
config(). Annotations that can be inherited are for example Mapping,
IterableMapping, MapMapping, or BeanMapping.
If no strategy is configured, the strategy given via MapperConfig.mappingInheritanceStrategy() will be
applied, using MappingInheritanceStrategy.EXPLICIT as default.
@Mapping configurations of prototype methods in the interface
specified with config().public abstract NullValueCheckStrategy nullValueCheckStrategy
MapperConfig or Mapping.public abstract boolean disableSubMappingMethodsGeneration
true MapStruct will not try to
automatically generate sub-mapping methods.
Can be configured by the MapperConfig.disableSubMappingMethodsGeneration() as well.
Note: If you need to use disableSubMappingMethodsGeneration please contact the MapStruct team at
mapstruct.org or
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.