@Target(value={ANNOTATION_TYPE,METHOD,FIELD,TYPE,PARAMETER}) @Retention(value=RUNTIME) public @interface JsonInclude
Note that inclusion criteria is checked on Java object level
and NOT on JSON output -- so even with JsonInclude.Include.NON_NULL
it is possible that JSON null values are output, if object reference
in question is not `null`. An example is AtomicReference
instance constructed to reference null
value: such a value
would be serialized as JSON null, and not filtered out.
In such cases JsonInclude.Include.NON_EMPTY
should be used instead, since missing
reference (that is, reference to Java null) is considered "empty" (it is also
considered "default", so match JsonInclude.Include.NON_DEFAULT
).
Modifier and Type | Optional Element and Description |
---|---|
JsonInclude.Include |
content
Inclusion rule to use for entries ("content") of annotated
Map s; defaults to JsonInclude.Include.ALWAYS . |
JsonInclude.Include |
value
Inclusion rule to use for instances (values) of types (Classes) or
properties annotated.
|
public abstract JsonInclude.Include value
public abstract JsonInclude.Include content
Map
s; defaults to JsonInclude.Include.ALWAYS
.Copyright © 2008–2015 FasterXML. All rights reserved.