Top Description Methods
com.fasterxml.jackson.annotation

public @Interface JsonAnySetter

extends Annotation
Annotations
@Target:ANNOTATION_TYPE, METHOD, FIELD
@Retention:RUNTIME
@JacksonAnnotation
Imports
java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

Marker annotation that can be used to define a logical "any setter" mutator -- either using non-static two-argument method (first argument name of property, second value to set) or a field (of type java.util.Map or POJO) - to be used as a "fallback" handler for all otherwise unrecognized properties found from JSON content. It is similar to javax.xml.bind.annotation.XmlAnyElement in behavior; and can only be used to denote a single property per type.

If used, all otherwise unmapped key-value pairs from JSON Object values are added using mutator.

Note

ability to annotated fields was added in version 2.8; earlier only methods could be annotated.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True if annotation is enabled (normal case); false if it is to be ignored (only useful for mix-in annotations to "mask" annotation)
enabled
()

Optional argument that defines whether this annotation is active or not.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

enabledback to summary
public boolean enabled()

Optional argument that defines whether this annotation is active or not. The only use for value 'false' if for overriding purposes. Overriding may be necessary when used with "mix-in annotations" (aka "annotation overrides"). For most cases, however, default value of "true" is just fine and should be omitted.

Returns:boolean

True if annotation is enabled (normal case); false if it is to be ignored (only useful for mix-in annotations to "mask" annotation)

Since
2.9