mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#271 Improving JavaDocs for @Mapping#expression()
This commit is contained in:
parent
d3de4991c9
commit
483b88c6d2
@ -92,14 +92,29 @@ public @interface Mapping {
|
|||||||
String constant() default "";
|
String constant() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An expression {@link String} based on which the specified target property is to be set. The format is determined
|
* An expression {@link String} based on which the specified target property is to be set.
|
||||||
* by a type of expression. For instance:
|
* <p>
|
||||||
* {@code expression = "java(new org.example.TimeAndFormat( s.getTime(), s.getFormat() ))")} will insert the java
|
* Currently, Java is the only supported "expression language" and expressions must be given in form of Java
|
||||||
* expression in the designated {@link #target()} property.
|
* expressions using the following format: {@code java(<EXPRESSION>)}. For instance the mapping
|
||||||
* <p>
|
* <p>
|
||||||
* Either this attribute or {@link #source()} or {@link #constant()} may be specified for a given mapping.
|
|
||||||
*
|
*
|
||||||
* @return A constant {@code String} constant specifying the value for the designated target property
|
* <pre>
|
||||||
|
* {@code @Mapping(
|
||||||
|
* target = "someProp",
|
||||||
|
* expression = "java(new TimeAndFormat( s.getTime(), s.getFormat() ))"
|
||||||
|
* )}
|
||||||
|
* </pre>
|
||||||
|
* <p>
|
||||||
|
* will cause the following target property assignment to be generated:
|
||||||
|
* <p>
|
||||||
|
* {@code targetBean.setSomeProp( new TimeAndFormat( s.getTime(), s.getFormat() ) )}.
|
||||||
|
* <p>
|
||||||
|
* Any types referenced in expressions must be given via their fully-qualified name. Alternatively, types can be
|
||||||
|
* imported via {@link Mapper#imports()}.
|
||||||
|
* <p>
|
||||||
|
* Either this attribute, {@link #source()} or {@link #constant()} may be specified for a given mapping.
|
||||||
|
*
|
||||||
|
* @return An expression specifying the value for the designated target property
|
||||||
*/
|
*/
|
||||||
String expression() default "";
|
String expression() default "";
|
||||||
|
|
||||||
|
@ -90,14 +90,29 @@ public @interface Mapping {
|
|||||||
String constant() default "";
|
String constant() default "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An expression {@link String} based on which the specified target property is to be set. The format is determined
|
* An expression {@link String} based on which the specified target property is to be set.
|
||||||
* by a type of expression. For instance:
|
* <p>
|
||||||
* {@code expression = "java(new org.example.TimeAndFormat( s.getTime(), s.getFormat() ))")} will insert the java
|
* Currently, Java is the only supported "expression language" and expressions must be given in form of Java
|
||||||
* expression in the designated {@link #target()} property.
|
* expressions using the following format: {@code java(<EXPRESSION>)}. For instance the mapping
|
||||||
* <p>
|
* <p>
|
||||||
* Either this attribute or {@link #source()} or {@link #constant()} may be specified for a given mapping.
|
|
||||||
*
|
*
|
||||||
* @return A constant {@code String} constant specifying the value for the designated target property
|
* <pre>
|
||||||
|
* {@code @Mapping(
|
||||||
|
* target = "someProp",
|
||||||
|
* expression = "java(new TimeAndFormat( s.getTime(), s.getFormat() ))"
|
||||||
|
* )}
|
||||||
|
* </pre>
|
||||||
|
* <p>
|
||||||
|
* will cause the following target property assignment to be generated:
|
||||||
|
* <p>
|
||||||
|
* {@code targetBean.setSomeProp( new TimeAndFormat( s.getTime(), s.getFormat() ) )}.
|
||||||
|
* <p>
|
||||||
|
* Any types referenced in expressions must be given via their fully-qualified name. Alternatively, types can be
|
||||||
|
* imported via {@link Mapper#imports()}.
|
||||||
|
* <p>
|
||||||
|
* Either this attribute, {@link #source()} or {@link #constant()} may be specified for a given mapping.
|
||||||
|
*
|
||||||
|
* @return An expression specifying the value for the designated target property
|
||||||
*/
|
*/
|
||||||
String expression() default "";
|
String expression() default "";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user