Class StdKeyDeserializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.KeyDeserializer
-
- com.fasterxml.jackson.databind.deser.std.StdKeyDeserializer
-
- All Implemented Interfaces:
Serializable
public class StdKeyDeserializer extends KeyDeserializer implements Serializable
DefaultKeyDeserializerimplementation used for mostMaptypes Jackson supports. Implemented as "chameleon" (or swiss pocket knife) class; not particularly elegant, but helps reduce number of classes and jar size (class metadata adds significant per-class overhead; much more than bytecode).- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.KeyDeserializer
KeyDeserializer.None
-
-
Field Summary
Fields Modifier and Type Field Description protected FromStringDeserializer<?>_deserSome types that are deserialized using a helper deserializer.protected Class<?>_keyClassprotected int_kindstatic intTYPE_BOOLEANstatic intTYPE_BYTEstatic intTYPE_BYTE_ARRAYstatic intTYPE_CALENDARstatic intTYPE_CHARstatic intTYPE_CLASSstatic intTYPE_CURRENCYstatic intTYPE_DATEstatic intTYPE_DOUBLEstatic intTYPE_FLOATstatic intTYPE_INTstatic intTYPE_LOCALEstatic intTYPE_LONGstatic intTYPE_SHORTstatic intTYPE_URIstatic intTYPE_URLstatic intTYPE_UUID
-
Constructor Summary
Constructors Modifier Constructor Description protectedStdKeyDeserializer(int kind, Class<?> cls)protectedStdKeyDeserializer(int kind, Class<?> cls, FromStringDeserializer<?> deser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object_parse(String key, DeserializationContext ctxt)protected double_parseDouble(String key)protected int_parseInt(String key)protected long_parseLong(String key)protected Object_weirdKey(DeserializationContext ctxt, String key, Exception e)ObjectdeserializeKey(String key, DeserializationContext ctxt)Method called to deserialize aMapkey from JSON property name.static StdKeyDeserializerforType(Class<?> raw)Class<?>getKeyClass()
-
-
-
Field Detail
-
TYPE_BOOLEAN
public static final int TYPE_BOOLEAN
- See Also:
- Constant Field Values
-
TYPE_BYTE
public static final int TYPE_BYTE
- See Also:
- Constant Field Values
-
TYPE_SHORT
public static final int TYPE_SHORT
- See Also:
- Constant Field Values
-
TYPE_CHAR
public static final int TYPE_CHAR
- See Also:
- Constant Field Values
-
TYPE_INT
public static final int TYPE_INT
- See Also:
- Constant Field Values
-
TYPE_LONG
public static final int TYPE_LONG
- See Also:
- Constant Field Values
-
TYPE_FLOAT
public static final int TYPE_FLOAT
- See Also:
- Constant Field Values
-
TYPE_DOUBLE
public static final int TYPE_DOUBLE
- See Also:
- Constant Field Values
-
TYPE_LOCALE
public static final int TYPE_LOCALE
- See Also:
- Constant Field Values
-
TYPE_DATE
public static final int TYPE_DATE
- See Also:
- Constant Field Values
-
TYPE_CALENDAR
public static final int TYPE_CALENDAR
- See Also:
- Constant Field Values
-
TYPE_UUID
public static final int TYPE_UUID
- See Also:
- Constant Field Values
-
TYPE_URI
public static final int TYPE_URI
- See Also:
- Constant Field Values
-
TYPE_URL
public static final int TYPE_URL
- See Also:
- Constant Field Values
-
TYPE_CLASS
public static final int TYPE_CLASS
- See Also:
- Constant Field Values
-
TYPE_CURRENCY
public static final int TYPE_CURRENCY
- See Also:
- Constant Field Values
-
TYPE_BYTE_ARRAY
public static final int TYPE_BYTE_ARRAY
- See Also:
- Constant Field Values
-
_kind
protected final int _kind
-
_keyClass
protected final Class<?> _keyClass
-
_deser
protected final FromStringDeserializer<?> _deser
Some types that are deserialized using a helper deserializer.
-
-
Constructor Detail
-
StdKeyDeserializer
protected StdKeyDeserializer(int kind, Class<?> cls)
-
StdKeyDeserializer
protected StdKeyDeserializer(int kind, Class<?> cls, FromStringDeserializer<?> deser)
-
-
Method Detail
-
forType
public static StdKeyDeserializer forType(Class<?> raw)
-
deserializeKey
public Object deserializeKey(String key, DeserializationContext ctxt) throws IOException
Description copied from class:KeyDeserializerMethod called to deserialize aMapkey from JSON property name.- Specified by:
deserializeKeyin classKeyDeserializer- Throws:
IOException
-
getKeyClass
public Class<?> getKeyClass()
-
_parse
protected Object _parse(String key, DeserializationContext ctxt) throws Exception
- Throws:
Exception
-
_parseInt
protected int _parseInt(String key) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
_parseLong
protected long _parseLong(String key) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
_parseDouble
protected double _parseDouble(String key) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
_weirdKey
protected Object _weirdKey(DeserializationContext ctxt, String key, Exception e) throws IOException
- Throws:
IOException
-
-