mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#3577 Improve Mapping#ignoreByDefault
documentation
This commit is contained in:
parent
8e66445fe9
commit
5fbd36c443
@ -19,6 +19,8 @@ import static org.mapstruct.SubclassExhaustiveStrategy.COMPILE_ERROR;
|
||||
/**
|
||||
* Configures the mapping between two bean types.
|
||||
* <p>
|
||||
* Unless otherwise specified these properties are inherited to the generated bean mapping methods.
|
||||
* <p>
|
||||
* Either {@link #resultType()}, {@link #qualifiedBy()} or {@link #nullValueMappingStrategy()} must be specified.
|
||||
* </p>
|
||||
* <p><strong>Example:</strong> Determining the result type</p>
|
||||
@ -58,6 +60,8 @@ public @interface BeanMapping {
|
||||
|
||||
/**
|
||||
* Specifies the result type of the factory method to be used in case several factory methods qualify.
|
||||
* <p>
|
||||
* <b>NOTE</b>: This property is not inherited to generated mapping methods
|
||||
*
|
||||
* @return the resultType to select
|
||||
*/
|
||||
@ -145,6 +149,8 @@ public @interface BeanMapping {
|
||||
* source properties report.
|
||||
* <p>
|
||||
* <b>NOTE</b>: This does not support ignoring nested source properties
|
||||
* <p>
|
||||
* <b>NOTE</b>: This property is not inherited to generated mapping methods
|
||||
*
|
||||
* @return The source properties that should be ignored when performing a report
|
||||
*
|
||||
|
@ -39,7 +39,7 @@ The property name as defined in the http://www.oracle.com/technetwork/java/javas
|
||||
====
|
||||
[TIP]
|
||||
====
|
||||
By means of the `@BeanMapping(ignoreByDefault = true)` the default behavior will be *explicit mapping*, meaning that all mappings have to be specified by means of the `@Mapping` and no warnings will be issued on missing target properties.
|
||||
By means of the `@BeanMapping(ignoreByDefault = true)` the default behavior will be *explicit mapping*, meaning that all mappings (including nested ones) have to be specified by means of the `@Mapping` and no warnings will be issued on missing target properties.
|
||||
This allows to ignore all fields, except the ones that are explicitly defined through `@Mapping`.
|
||||
====
|
||||
[TIP]
|
||||
|
Loading…
x
Reference in New Issue
Block a user