File tree Expand file tree Collapse file tree
core-jdk8/src/main/java/org/mapstruct
core/src/main/java/org/mapstruct Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545public @interface Mapping {
4646
4747 /**
48- * The target name of the configured property as defined by the JavaBeans specification. If used to map an enum
49- * constant, the name of the constant member is to be given.
48+ * The target name of the configured property as defined by the JavaBeans specification. The same target property
49+ * must not be mapped more than once.
50+ * <p>
51+ * If used to map an enum constant, the name of the constant member is to be given. In this case, several values
52+ * from the source enum may be mapped to the same value of the target enum.
5053 *
5154 * @return The target name of the configured property or enum constant
5255 */
5558 /**
5659 * The source to use for this mapping. This can either be:
5760 * <ol>
58- * <li>The source name of the configured property as defined by the JavaBeans specification.</li>
61+ * <li>The source name of the configured property as defined by the JavaBeans specification.
62+ * <p>
63+ * This may either be a simple property name (e.g. "address") or a dot-separated property path (e.g. "address.city"
64+ * or "address.city.name"). In case the annotated method has several source parameters, the property name must
65+ * qualified with the parameter name, e.g. "addressParam.city".</li>
5966 * <li>When used to map an enum constant, the name of the constant member is to be given.</li>
6067 * </ol>
6168 * Either this attribute or {@link #constant()} or {@link #expression()} may be specified for a given mapping.
Original file line number Diff line number Diff line change 4343public @interface Mapping {
4444
4545 /**
46- * The target name of the configured property as defined by the JavaBeans specification. If used to map an enum
47- * constant, the name of the constant member is to be given.
46+ * The target name of the configured property as defined by the JavaBeans specification. The same target property
47+ * must not be mapped more than once.
48+ * <p>
49+ * If used to map an enum constant, the name of the constant member is to be given. In this case, several values
50+ * from the source enum may be mapped to the same value of the target enum.
4851 *
4952 * @return The target name of the configured property or enum constant
5053 */
5356 /**
5457 * The source to use for this mapping. This can either be:
5558 * <ol>
56- * <li>The source name of the configured property as defined by the JavaBeans specification.</li>
59+ * <li>The source name of the configured property as defined by the JavaBeans specification.
60+ * <p>
61+ * This may either be a simple property name (e.g. "address") or a dot-separated property path (e.g. "address.city"
62+ * or "address.city.name"). In case the annotated method has several source parameters, the property name must
63+ * qualified with the parameter name, e.g. "addressParam.city".</li>
5764 * <li>When used to map an enum constant, the name of the constant member is to be given.</li>
5865 * </ol>
5966 * Either this attribute or {@link #constant()} or {@link #expression()} may be specified for a given mapping.
You can’t perform that action at this time.
0 commit comments