Skip to content

Commit 1aeb62c

Browse files
committed
Fix javadocs for #107
1 parent 2c4944d commit 1aeb62c

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/main/java/com/fasterxml/jackson/annotation/JsonAnyGetter.java

+10-6
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77

88
/**
99
* 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>
1518
* 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.
1721
*/
1822
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD})
1923
@Retention(RetentionPolicy.RUNTIME)

src/main/java/com/fasterxml/jackson/annotation/JsonAnySetter.java

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*<p>
1919
* If used, all otherwise unmapped key-value pairs from JSON Object values
2020
* 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.
2124
*/
2225
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD})
2326
@Retention(RetentionPolicy.RUNTIME)

0 commit comments

Comments
 (0)