Package com.fasterxml.jackson.annotation
Annotation Interface JsonSetter
Annotation that can be used to define a non-static,
single-argument method to be used as a "setter" for a logical property
as an alternative to recommended
JsonProperty
annotation;
or (as of 2.9 and later), specify additional aspects of the
assigning property a value during serialization.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Helper class used to contain information from a singleJsonSetter
annotation, as well as to provide possible overrides from non-annotation sources. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionSpecifies action to take when input to match into content value (of aCollection
,Map
, array, or referential value) contains explicit `null` value (if format has one) to bind.Specifies action to take when input contains explicit `null` value (if format has one).Optional default argument that defines logical property this method is used to modify ("set"); this is the property name used in JSON content.
-
Element Details
-
value
String valueOptional default argument that defines logical property this method is used to modify ("set"); this is the property name used in JSON content.- Default:
- ""
-
nulls
Nulls nullsSpecifies action to take when input contains explicit `null` value (if format has one). Default action, in absence of any explicit configuration, is usuallyNulls.SET
, meaning that the `null` is set as value using setter.NOTE: is not usually used in case property value is missing, unless data format specifies that there is defaulting which would result in an explicit null assignment.
- Default:
- DEFAULT
-
contentNulls
Nulls contentNullsSpecifies action to take when input to match into content value (of aCollection
,Map
, array, or referential value) contains explicit `null` value (if format has one) to bind. Default action, in absence of any explicit configuration, is usuallyNulls.SET
, meaning that the `null` is included as usual.- Default:
- DEFAULT
-