|
6 | 6 | import java.lang.annotation.Target;
|
7 | 7 |
|
8 | 8 | /**
|
9 |
| - * Marker annotation that can be used to define a non-static, |
| 9 | + * Marker annotation that can be used to define a logical "any setter" mutator -- |
| 10 | + * either using non-static |
10 | 11 | * two-argument method (first argument name of property, second value
|
11 |
| - * to set), to be used as a "fallback" handler |
| 12 | + * to set) or a field (of type {@link java.util.Map} or POJO) - |
| 13 | + * to be used as a "fallback" handler |
12 | 14 | * for all otherwise unrecognized properties found from JSON content.
|
13 | 15 | * It is similar to {@link javax.xml.bind.annotation.XmlAnyElement}
|
14 | 16 | * in behavior; and can only be used to denote a single property
|
15 | 17 | * per type.
|
16 | 18 | *<p>
|
17 | 19 | * If used, all otherwise unmapped key-value pairs from JSON Object values
|
18 |
| - * are added to the property (of type Map or bean). |
| 20 | + * are added using mutator. |
19 | 21 | */
|
20 | 22 | @Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD})
|
21 | 23 | @Retention(RetentionPolicy.RUNTIME)
|
22 | 24 | @JacksonAnnotation
|
23 | 25 | public @interface JsonAnySetter
|
24 | 26 | {
|
| 27 | + /** |
| 28 | + * Optional argument that defines whether this annotation is active |
| 29 | + * or not. The only use for value 'false' if for overriding purposes. |
| 30 | + * Overriding may be necessary when used |
| 31 | + * with "mix-in annotations" (aka "annotation overrides"). |
| 32 | + * For most cases, however, default value of "true" is just fine |
| 33 | + * and should be omitted. |
| 34 | + * |
| 35 | + * @since 2.9 |
| 36 | + */ |
| 37 | + boolean enabled() default true; |
25 | 38 | }
|
0 commit comments