@MyReplacement meta-annotation defined below as:
@Replace(expression = "`", replacement = "")
@Parsed
public @interface MyReplacement {
@Copy(to = Parsed.class)
String field() default "";
@Copy(to = Parsed.class, property = "index")
int myIndex() default -1;
}
Values set on attributes field or myIndex in @MyReplacement will be assigned to the
attributes field and index of the @Parsed annotation. This allows you to apply the
@MyReplacement annotation to any given field of your class while configuring the field name and index
to be set for the @Parsed annotation. This eliminates the need for adding explicit, additional annotations and
their specific property values to each and every field.
The following class can now make use of the @MyReplacement annotation to apply the the annotations
@Replace and @Parsed, configuring the properties of the "inherited" @Parsed:
public class MyBean {
@MyReplacement
public String id;
@MyReplacementUpperCase(field = "client_name")
public String name;
@MyReplacementUpperCase(myIndex = 4)
public String address;
}
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the name of the property in the given annotation class that should receive the value of the meta-annotation property.Target property of the given annotation class that is part of a meta-annotation. |
| public Class | Returns: the class whose properties will be set from a given attribute of a meta-annotationTarget annotation class that is part of a meta-annotation. |
| property | back to summary |
|---|---|
| public String property() Target property of the given annotation class that is part of a meta-annotation.
| |
| to | back to summary |
|---|---|
| public Class Target annotation class that is part of a meta-annotation.
| |