| Modifier and Type | Required Element and Description |
|---|---|
Class<?> |
target |
| Modifier and Type | Optional Element and Description |
|---|---|
org.mapstruct.CollectionMappingStrategy |
collectionMappingStrategy
The strategy to be applied when propagating the value of collection-typed properties.
|
boolean |
convertGenerate
是否生成转换的接口,当只想生成反向接口时,可以指定当前属性为
false |
boolean |
cycleAvoiding
是否需要避免对象循环嵌套
|
Class<?>[] |
imports |
String |
mapperName
生成的 Mapper 接口名称
|
String |
mapperNameSuffix
生成的 Mapper 接口名称后缀,生成的反向转换接口同时生效
|
Class<? extends Annotation> |
mappingControl
Allows detailed control over the mapping process.
|
org.mapstruct.NullValueCheckStrategy |
nullValueCheckStrategy
Determines when to include a null check on the source property value of a bean mapping.
|
org.mapstruct.NullValueMappingStrategy |
nullValueIterableMappingStrategy
The strategy to be applied when
null is passed as source argument value to an IterableMapping of
this mapper. |
org.mapstruct.NullValueMappingStrategy |
nullValueMappingStrategy
The strategy to be applied when
null is passed as source argument value to the methods of this mapper. |
org.mapstruct.NullValuePropertyMappingStrategy |
nullValuePropertyMappingStrategy
The strategy to be applied when a source bean property is
null or not present. |
boolean |
reverseConvertGenerate
是否生成反向转换的接口
|
org.mapstruct.ReportingPolicy |
typeConversionPolicy
How lossy (narrowing) conversion, for instance long to integer should be
reported.
|
org.mapstruct.ReportingPolicy |
unmappedSourcePolicy
How unmapped properties of the source type of a mapping should be
reported.
|
org.mapstruct.ReportingPolicy |
unmappedTargetPolicy
How unmapped properties of the target type of a mapping should be
reported.
|
Class<?>[] |
useEnums
转换需要依赖的枚举,依赖的枚举,需要被 AutoEnumMapper 所注解
|
Class<?>[] |
uses |
public abstract Class<?> target
public abstract Class<?>[] uses
public abstract Class<?>[] useEnums
public abstract Class<?>[] imports
public abstract boolean convertGenerate
falsetrue 生成类型转换的接口 false 不生成类型转换的接口public abstract String mapperName
public abstract String mapperNameSuffix
public abstract boolean reverseConvertGenerate
public abstract boolean cycleAvoiding
循环嵌套:A中有属性类型B,B中有属性类型A,且可能对象之间互相引用
public abstract org.mapstruct.ReportingPolicy unmappedSourcePolicy
public abstract org.mapstruct.ReportingPolicy unmappedTargetPolicy
public abstract org.mapstruct.ReportingPolicy typeConversionPolicy
public abstract org.mapstruct.CollectionMappingStrategy collectionMappingStrategy
orderDto.addOrderLine()).
Any setting given for this attribute will take precedence over MapperConfig.collectionMappingStrategy(),
if present.
public abstract org.mapstruct.NullValueMappingStrategy nullValueMappingStrategy
null is passed as source argument 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 org.mapstruct.NullValueMappingStrategy nullValueIterableMappingStrategy
null is passed as source argument value to an IterableMapping of
this mapper. If unset, the strategy set with nullValueMappingStrategy() will be applied. If neither
strategy is configured, the strategy given via MapperConfig.nullValueIterableMappingStrategy() will be
applied, using NullValueMappingStrategy.RETURN_NULL by default.null is passed as source value to an IterableMapping of
this mapper.public abstract org.mapstruct.NullValuePropertyMappingStrategy nullValuePropertyMappingStrategy
null or not present. If no strategy is
configured, the strategy given via MapperConfig.nullValuePropertyMappingStrategy() will be applied,
NullValuePropertyMappingStrategy.SET_TO_NULL will be used by default.null is passed as source property value or the source property
is not present.public abstract org.mapstruct.NullValueCheckStrategy nullValueCheckStrategy
MapperConfig, BeanMapping or Mapping.public abstract Class<? extends Annotation> mappingControl
DeepClone,
NoComplexMapping,
MappingControlCopyright © 2025. All rights reserved.