Skip to content

Commit ae3a8d3

Browse files
committed
Fix #109
1 parent 98f2f31 commit ae3a8d3

File tree

2 files changed

+27
-3
lines changed

2 files changed

+27
-3
lines changed

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

+11
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,15 @@
2020
@JacksonAnnotation
2121
public @interface JsonAnyGetter
2222
{
23+
/**
24+
* Optional argument that defines whether this annotation is active
25+
* or not. The only use for value 'false' if for overriding purposes.
26+
* Overriding may be necessary when used
27+
* with "mix-in annotations" (aka "annotation overrides").
28+
* For most cases, however, default value of "true" is just fine
29+
* and should be omitted.
30+
*
31+
* @since 2.9
32+
*/
33+
boolean enabled() default true;
2334
}

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

+16-3
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,33 @@
66
import java.lang.annotation.Target;
77

88
/**
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
1011
* 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
1214
* for all otherwise unrecognized properties found from JSON content.
1315
* It is similar to {@link javax.xml.bind.annotation.XmlAnyElement}
1416
* in behavior; and can only be used to denote a single property
1517
* per type.
1618
*<p>
1719
* 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.
1921
*/
2022
@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.FIELD})
2123
@Retention(RetentionPolicy.RUNTIME)
2224
@JacksonAnnotation
2325
public @interface JsonAnySetter
2426
{
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;
2538
}

0 commit comments

Comments
 (0)