CARVIEW |
Select Language
HTTP/2 200
date: Sat, 19 Jul 2025 14:56:29 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"246f98b7a1a882de547f81566f06b0c3"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=DZXXLrf7c0qfUpr6HCetjJU6vqfGtF5fLr7i5yFmDKHeoAsrbl9AVIR2BOlxbuh2v4%2FkZh79lzIwzqtLudOZGGVgnxyyjSdJmaoRklSXQlX8TIGYzzVp3Vl5Vfi4cY8TwBszstmK%2FRP1BEMb6YMW3vozmJRcdh7RQTzLdhOf2SCdoz1yQbN7wMuI6yZ3MJ%2FatYCz1CukF5udq0tDcqzh8oZcFvF4ujNBV9lpXsPvEmN%2BLldJjSMeEyR0r84cCi9d6Men27pYGfIE3NA7QGIUVA%3D%3D--kY8%2BzshlGr8xQs7t--GKLVrhsgEQogqK3y%2BLNe5A%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1504560997.1752936989; Path=/; Domain=github.com; Expires=Sun, 19 Jul 2026 14:56:29 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sun, 19 Jul 2026 14:56:29 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: C9DE:21B12E:5CD5F4:746152:687BB21C
Databind annotations · FasterXML/jackson-databind Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Databind annotations
Tatu Saloranta edited this page Nov 19, 2013
·
6 revisions
In addition to core Jackson annotations, jackson-databind
adds a small set of annotations that are tied to types defined in databind package.
These are used for more fine-grained definition of handlers.
-
@JsonSerialize (method, field) can be used to denote:
- Explicit serializer (of type
JsonSerializer
) to use, with following properties:-
using
for value of property itself -
keyUsing
for keys ofjava.util.Map
valued properties -
contentUsing
for contents of structured values (elements of arrays,java.util.Collection
s, values ofjava.util.Map
s) -
nullUsing
when serializing Javanull
valued properties (NEW with 2.3)
-
- Explicit type to use (instead of actual run time type) with
-
as
for property value -
keyAs
forjava.util.Map
keys -
contentAs
for elements/values of structured types - NOTE: type used must be compatible with nominal type (a super type)
-
- Whether static or dynamic typing (default: static typing) is to be used:
typing
property- Allowed values are
DYNAMIC
(for dynamic runtime type),STATIC
(to use declared, "nominal" type) orDEFAULT_TYPING
to use defaults forObjectMapper
- Allowed values are
- Converter object (of type
Converter
) to use-
converter
for property value itself, or -
contentConverter
for values of structured types (elements of array,java.util.Collection
s; values ofjava.util.Map
s)
-
- Explicit serializer (of type
-
@JsonDeserialize (method, field) can be used to denote:
- Explicit deserializer to use:
-
using
for values (scalars or structured) -
contentUsing
for values of structured types (elements ofarrays
andjava.util.Collection
s, values ofjava.util.Map
s) -
keyUsing
for keys ofjava.util.Map
s
-
- Explicit types to use with
-
as
property (must be compatible with declared type, i.e. subtype) - Similarly
keyAs()
andcontentAs()
for specifying key type forjava.util.Maps
, content type for Collections, arrays.
-
- Builder object (of any type) to use:
builder
- Converter object (of type
Converter
) to use-
converter
for property value itself, or -
contentConverter
for values of structured types (elements of array,java.util.Collection
s; values ofjava.util.Map
s)
-
- Explicit deserializer to use:
-
@JsonNaming (Class) is used to indicate
PropertyNamingStrategy
to use for annotated type- Note that
databind
module includes implementation of two alternate naming strategies:-
PropertyNamingStrategy.LowerCaseWithUnderScoresStrategy
: supports "C-style" naming, likefirst_name
(instead of Java "firstName") -
PropertyNamingStrategy.PascalCaseStrategy
: supports names like "FirstName"
-
- Note that
-
@JsonPOJOBuilder (Class) is used to configure so-called
Builder
objects; builders can be specified using@JsonDeserialize.builder
property -
@JsonValueInstantiator (Class) is used to specify custom
ValueInstantiator
to use for annotated type- Use of
ValueInstantiator
is an advanced topic.
- Use of
Following annotations work together with standard @JsonTypeInfo
annotation defined by core annotations package.
- @JsonTypeResolver (class) can be used to plug in a custom type information handler, to replace default one (for specific class)
- @JsonTypeIdResolver (class) can be used to replace standard type id converter (type to/from JSON String) with a custom version; for example, to create more convenient handler for using logical type names.
It is also possible to use JAXB annotations in addition to or instead of these core annotations.
Clone this wiki locally
You can’t perform that action at this time.