@Target(value={ANNOTATION_TYPE,METHOD,FIELD,TYPE,PARAMETER})
@Retention(value=RUNTIME)
public @interface JsonDeserialize
An example annotation would be:
@JsonDeserialize(using=MySerializer.class, as=MyHashMap.class, keyAs=MyHashKey.class, contentAs=MyHashValue.class )
Something to note on usage:
ObjectMapper.configOverride(java.lang.Class<?>)
)
should be targeted at Builder class, not target POJO class.
Modifier and Type | Optional Element and Description |
---|---|
java.lang.Class<?> |
as
Concrete type to deserialize values as, instead of type otherwise
declared.
|
java.lang.Class<?> |
builder
Annotation for specifying if an external Builder class is to
be used for building up deserialized instances of annotated
class.
|
java.lang.Class<?> |
contentAs
Concrete type to deserialize content (elements
of a Collection/array, values of Maps) values as,
instead of type otherwise declared.
|
java.lang.Class<? extends Converter> |
contentConverter
Similar to
converter() , but used for values of structures types
(List, arrays, Maps). |
java.lang.Class<? extends JsonDeserializer> |
contentUsing
Deserializer class to use for deserializing contents (elements
of a Collection/array, values of Maps) of annotated property.
|
java.lang.Class<? extends Converter> |
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).
|
java.lang.Class<?> |
keyAs
Concrete type to deserialize keys of
Map as,
instead of type otherwise declared. |
java.lang.Class<? extends KeyDeserializer> |
keyUsing
Deserializer class to use for deserializing Map keys
of annotated property.
|
java.lang.Class<? extends JsonDeserializer> |
using
Deserializer class to use for deserializing associated value.
|
public abstract java.lang.Class<? extends JsonDeserializer> using
public abstract java.lang.Class<? extends JsonDeserializer> contentUsing
public abstract java.lang.Class<? extends KeyDeserializer> keyUsing
public abstract java.lang.Class<?> builder
public abstract java.lang.Class<? extends Converter> converter
public abstract java.lang.Class<? extends Converter> contentConverter
converter()
, but used for values of structures types
(List, arrays, Maps).public abstract java.lang.Class<?> as
Bogus type Void
can be used to indicate that declared
type is used as is (i.e. this annotation property has no setting);
this since annotation properties are not allowed to have null value.
Note: if using()
is also used it has precedence
(since it directly specified
deserializer, whereas this would only be used to locate the
deserializer)
and value of this annotation property is ignored.
public abstract java.lang.Class<?> keyAs
Map
as,
instead of type otherwise declared.
Must be a subtype of declared type; otherwise an exception may be
thrown by deserializer.public abstract java.lang.Class<?> contentAs
Copyright © 2010 - 2020 Adobe. All Rights Reserved