Package com.fasterxml.jackson.annotation
Annotation Type JsonIncludeProperties
-
@Target({ANNOTATION_TYPE,TYPE,METHOD,CONSTRUCTOR,FIELD}) @Retention(RUNTIME) public @interface JsonIncludePropertiesAnnotation that can be used to either only include serialization of properties (during serialization), or only include processing of JSON properties read (during deserialization).Example:
// to only include specified fields from being serialized or deserialized // (i.e. only include in JSON output; or being set even if they were included) @JsonIncludeProperties({ "internalId", "secretKey" })Annotation can be applied both to classes and to properties. If used for both, actual set will be union of all includes: that is, you can only add properties to include, not remove or override. So you can not remove properties to include using per-property annotation.
- Since:
- 2.12
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description OptBooleanorderProperty that can be enabled to indicate that the order of properties invalue()is the order in which properties should be serialized; that is,value()should be used as if it wasJsonPropertyOrder.value()(unless that annotation already exists.java.lang.String[]valueNames of properties to include.
-
-
-
-
order
OptBoolean order
Property that can be enabled to indicate that the order of properties invalue()is the order in which properties should be serialized; that is,value()should be used as if it wasJsonPropertyOrder.value()(unless that annotation already exists. This is useful in reducing amount of annotation duplication.Property defaults to
OptBoolean.DEFAULT, meaning "undefined" (which effectively translates intoOptBoolean.FALSE).- Since:
- 2.22
- Default:
- com.fasterxml.jackson.annotation.OptBoolean.DEFAULT
-
-