diff --git a/core-jdk8/src/main/java/org/mapstruct/Mapping.java b/core-jdk8/src/main/java/org/mapstruct/Mapping.java index 15cb8d0a4..7c264f253 100644 --- a/core-jdk8/src/main/java/org/mapstruct/Mapping.java +++ b/core-jdk8/src/main/java/org/mapstruct/Mapping.java @@ -66,7 +66,7 @@ public @interface Mapping { *
- * Either this attribute or {@link #source()} or {@link #expression()} may be specified for a given mapping. + * This attribute can not be used together with {@link #source()}, {@link #defaultValue()} or {@link #expression()}. * * @return A constant {@code String} constant specifying the value for the designated target property */ @@ -112,7 +112,7 @@ public @interface Mapping { * Any types referenced in expressions must be given via their fully-qualified name. Alternatively, types can be * imported via {@link Mapper#imports()}. *
- * Either this attribute, {@link #source()} or {@link #constant()} may be specified for a given mapping. + * This attribute can not be used together with {@link #source()}, {@link #defaultValue()} or {@link #constant()}. * * @return An expression specifying the value for the designated target property */ @@ -156,14 +156,13 @@ public @interface Mapping { String[] dependsOn() default { }; /** + * In case the source property is {@code null}, the provided default {@link String} value is set. If the designated + * target property is not of type {@code String}, the value will be converted by applying a matching conversion + * method or built-in conversion. *
- * In case the source property is null the provided default {@link String} value is set. - * If the designated target - * property is not of type {@code String}, the value will be converted by applying a matching conversion method or - * built-in conversion. - *
- * Either this attribute or {@link #constant()} or {@link #expression()} may be specified for a given mapping. - * @return Default value to set in case the source property is null. + * This attribute can not be used together with {@link #constant()} or {@link #expression()}. + * + * @return Default value to set in case the source property is {@code null}. */ String defaultValue() default ""; } diff --git a/core/src/main/java/org/mapstruct/Mapping.java b/core/src/main/java/org/mapstruct/Mapping.java index 644ba5720..5221a6775 100644 --- a/core/src/main/java/org/mapstruct/Mapping.java +++ b/core/src/main/java/org/mapstruct/Mapping.java @@ -64,7 +64,7 @@ public @interface Mapping { *- * Either this attribute or {@link #source()} or {@link #expression()} may be specified for a given mapping. + * This attribute can not be used together with {@link #source()}, {@link #defaultValue()} or {@link #expression()}. * * @return A constant {@code String} constant specifying the value for the designated target property */ @@ -94,6 +94,7 @@ public @interface Mapping { *
* Currently, Java is the only supported "expression language" and expressions must be given in form of Java
* expressions using the following format: {@code java(
*
*
- * Either this attribute, {@link #source()} or {@link #constant()} may be specified for a given mapping.
+ * This attribute can not be used together with {@link #source()}, {@link #defaultValue()} or {@link #constant()}.
*
* @return An expression specifying the value for the designated target property
*/
@@ -153,14 +154,13 @@ public @interface Mapping {
String[] dependsOn() default { };
/**
+ * In case the source property is {@code null}, the provided default {@link String} value is set. If the designated
+ * target property is not of type {@code String}, the value will be converted by applying a matching conversion
+ * method or built-in conversion.
*
- * In case the source property is null the provided default {@link String} value is set.
- * If the designated target
- * property is not of type {@code String}, the value will be converted by applying a matching conversion method or
- * built-in conversion.
- *
* {@code @Mapping(
@@ -109,7 +110,7 @@ public @interface Mapping {
* Any types referenced in expressions must be given via their fully-qualified name. Alternatively, types can be
* imported via {@link Mapper#imports()}.
*