An example annotation would be:
@JsonDeserialize(using=MySerializer.class,
as=MyHashMap.class,
keyAs=MyHashKey.class,
contentAs=MyHashValue.class
)
Something to note on usage:
com.fasterxml.jackson.databind.ObjectMapper#configOverride )
should be targeted at Builder class, not target POJO class.
| Modifier and Type | Method and Description |
|---|---|
| public Class | |
| public Class | builder()
Annotation for specifying if an external Builder class is to be used for building up deserialized instances of annotated class. |
| public Class | contentAs()
Concrete type to deserialize content (elements of a Collection/array, values of Maps) values as, instead of type otherwise declared. |
| public Class | contentConverter()
Similar to |
| public Class | contentUsing()
Deserializer class to use for deserializing contents (elements of a Collection/array, values of Maps) of annotated property. |
| public Class | converter()
Which helper object (if any) is to be used to convert from Jackson-bound intermediate type (source type of converter) into actual property type (which must be same as result type of converter). |
| public Class | |
| public Class | keyUsing()
Deserializer class to use for deserializing Map keys of annotated property or Map keys of value type so annotated. |
| public Class |
| as | back to summary |
|---|---|
| public Class Concrete type to deserialize values as, instead of type otherwise declared. Must be a subtype of declared type; otherwise an exception may be thrown by deserializer.
Bogus type Note if | |
| builder | back to summary |
|---|---|
| public Class Annotation for specifying if an external Builder class is to be used for building up deserialized instances of annotated class. If so, an instance of referenced class is first constructed (possibly using a Creator method; or if none defined, using default constructor), and its "with-methods" are used for populating fields; and finally "build-method" is invoked to complete deserialization. | |
| contentAs | back to summary |
|---|---|
| public Class Concrete type to deserialize content (elements of a Collection/array, values of Maps) values as, instead of type otherwise declared. Must be a subtype of declared type; otherwise an exception may be thrown by deserializer. | |
| contentConverter | back to summary |
|---|---|
| public Class Similar to
| |
| contentUsing | back to summary |
|---|---|
| public Class Deserializer class to use for deserializing contents (elements
of a Collection/array, values of Maps) of annotated property.
Can only be used on accessors (methods, fields, constructors), to
apply to values of
| |
| converter | back to summary |
|---|---|
| public Class Which helper object (if any) is to be used to convert from Jackson-bound intermediate type (source type of converter) into actual property type (which must be same as result type of converter). This is often used for two-step deserialization; Jackson binds data into suitable intermediate type (like Tree representation), and converter then builds actual property type.
| |
| keyAs | back to summary |
|---|---|
| public Class Concrete type to deserialize keys of | |
| keyUsing | back to summary |
|---|---|
| public Class Deserializer class to use for deserializing Map keys
of annotated property or Map keys of value type so annotated.
Can be used both on accessors (methods, fields, constructors), to
apply to values of | |
| using | back to summary |
|---|---|
| public Class Deserializer class to use for deserializing associated value. Depending on what is annotated, value is either an instance of annotated class (used globablly anywhere where class deserializer is needed); or only used for deserializing the value of the property annotated.
| |