#3577 Improve Mapping#ignoreByDefault documentation

This commit is contained in:
Zegveld 2024-04-28 20:20:11 +02:00 committed by GitHub
parent 8e66445fe9
commit 5fbd36c443
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -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
*

View File

@ -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]