Skip to content

Jackson annotations

Maria Zaitseva edited this page Feb 19, 2024 · 1 revision
Annotation Usage Example Description
@JsonProperty("age") Indicates that the annotated field or method should be serialized and deserialized with a specific name.
@JsonAlias({"firstName", "first_name"}) Specifies one or more alternative names for a property during deserialization.
@JsonIgnore Indicates that the annotated field or method should be ignored during serialization and deserialization.
@JsonIgnoreProperties(ignoreUnknown=true) Indicates that one or more properties should be ignored during serialization and deserialization.
@JsonInclude(Include.NON_NULL) Specifies which properties should be included during serialization based on their values.
@JsonGetter("getFirstName") Specifies a custom getter method for a property during serialization.
@JsonSetter("setFirstName") Specifies a custom setter method for a property during deserialization.
@JsonAnyGetter Marks a method that should be used to serialize additional properties as key-value pairs.
@JsonAnySetter Marks a method that should be used to deserialize additional properties as key-value pairs.
@JsonCreator Indicates a constructor or factory method to be used for deserialization.
@JsonValue Specifies a method to be used to serialize an object as its JSON representation.
@JsonRawValue Indicates that the annotated property should be serialized directly as a JSON string without quotes.
@JsonRootName("user") Specifies the root name for a serialized object.
  push(%rbp)
  %rbp = %rsp
  push(%r13)
  push(%rax)
  %rbp[-0x10] = $0x0, 
  %rbp[-0x10] = %r13, 
  %eax = 0
  %edi = 0
  callq 0x10f5109f0
  %r13 = %rax
  %rdi = %r13
  main()
  %rsp += $0x8
  popq   %r13
  popq   %rbp
  retq

Clone this wiki locally