File tree 2 files changed +13
-6
lines changed
src/main/java/com/fasterxml/jackson/annotation
2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 7
7
8
8
/**
9
9
* Marker annotation that can be used to define a non-static,
10
- * no-argument method or member field as something of a reverse of
11
- * {@link JsonAnySetter} method; basically being used like a
12
- * getter but such that contents of the returned Map (type <b>must</b> be
13
- * {@link java.util.Map}) are serialized as if they were actual properties
14
- * of the bean that contains method/field with this annotations.
10
+ * no-argument method to be an "any getter"; accessor for getting
11
+ * a set of key/value pairs, to be serialized as part of containing POJO
12
+ * (similar to unwrapping) along with regular property values it has.
13
+ * This typically serves as a counterpart
14
+ * to "any setter" mutators (see {@link JsonAnySetter}).
15
+ * Note that the return type of annotated methods <b>must</b> be
16
+ * {@link java.util.Map}).
17
+ *<p>
15
18
* As with {@link JsonAnySetter}, only one property should be annotated
16
- * with this annotation.
19
+ * with this annotation; if multiple methods are annotated, an exception
20
+ * may be thrown.
17
21
*/
18
22
@ Target ({ElementType .ANNOTATION_TYPE , ElementType .METHOD })
19
23
@ Retention (RetentionPolicy .RUNTIME )
Original file line number Diff line number Diff line change 18
18
*<p>
19
19
* If used, all otherwise unmapped key-value pairs from JSON Object values
20
20
* are added using mutator.
21
+ *<p>
22
+ * NOTE: ability to annotated fields was added in version 2.8; earlier only
23
+ * methods could be annotated.
21
24
*/
22
25
@ Target ({ElementType .ANNOTATION_TYPE , ElementType .METHOD , ElementType .FIELD })
23
26
@ Retention (RetentionPolicy .RUNTIME )
You can’t perform that action at this time.
0 commit comments