Package com.microsoft.rest.serializer
Class FlatteningDeserializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonDeserializer<T>
-
- com.fasterxml.jackson.databind.deser.std.StdDeserializer<Object>
-
- com.microsoft.rest.serializer.FlatteningDeserializer
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider,com.fasterxml.jackson.databind.deser.ResolvableDeserializer,Serializable
public final class FlatteningDeserializer extends com.fasterxml.jackson.databind.deser.std.StdDeserializer<Object> implements com.fasterxml.jackson.databind.deser.ResolvableDeserializer
Custom serializer for deserializing complex types with wrapped properties. For example, a property with annotation @JsonProperty(value = "properties.name") will be mapped to a top level "name" property in the POJO model.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFlatteningDeserializer(Class<?> vc, com.fasterxml.jackson.databind.JsonDeserializer<?> defaultDeserializer, com.fasterxml.jackson.databind.ObjectMapper mapper)Creates an instance of FlatteningDeserializer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectdeserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext cxt)ObjectdeserializeWithType(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext cxt, com.fasterxml.jackson.databind.jsontype.TypeDeserializer tDeserializer)static com.fasterxml.jackson.databind.module.SimpleModulegetModule(com.fasterxml.jackson.databind.ObjectMapper mapper)Gets a module wrapping this serializer as an adapter for the Jackson ObjectMapper.voidresolve(com.fasterxml.jackson.databind.DeserializationContext cxt)-
Methods inherited from class com.fasterxml.jackson.databind.deser.std.StdDeserializer
_byteOverflow, _coercedTypeDesc, _coerceEmptyString, _coerceIntegral, _coerceNullToken, _coerceTextualNull, _deserializeFromArray, _deserializeFromEmpty, _deserializeWrappedValue, _failDoubleToIntCoercion, _findNullProvider, _hasTextualNull, _intOverflow, _isEmptyOrTextualNull, _isIntNumber, _isNaN, _isNegInf, _isPosInf, _neitherNull, _nonNullNumber, _parseBooleanFromInt, _parseBooleanPrimitive, _parseBytePrimitive, _parseDate, _parseDate, _parseDateFromArray, _parseDoublePrimitive, _parseDoublePrimitive, _parseFloatPrimitive, _parseFloatPrimitive, _parseIntPrimitive, _parseIntPrimitive, _parseLongPrimitive, _parseLongPrimitive, _parseShortPrimitive, _parseString, _reportFailedNullCoerce, _shortOverflow, _verifyEndArrayForSingle, _verifyNullForPrimitive, _verifyNullForPrimitiveCoercion, _verifyNullForScalarCoercion, _verifyNumberForScalarCoercion, _verifyStringForScalarCoercion, findContentNullProvider, findContentNullStyle, findConvertingContentDeserializer, findDeserializer, findFormatFeature, findFormatOverrides, findValueNullProvider, getValueClass, getValueType, handledType, handleMissingEndArrayForSingle, handleUnknownProperty, isDefaultDeserializer, isDefaultKeyDeserializer, parseDouble
-
Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, findBackReference, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, isCachable, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
-
-
-
Constructor Detail
-
FlatteningDeserializer
protected FlatteningDeserializer(Class<?> vc, com.fasterxml.jackson.databind.JsonDeserializer<?> defaultDeserializer, com.fasterxml.jackson.databind.ObjectMapper mapper)
Creates an instance of FlatteningDeserializer.- Parameters:
vc- handled typedefaultDeserializer- the default JSON mapperAdaptermapper- the object mapper for default deserializations
-
-
Method Detail
-
getModule
public static com.fasterxml.jackson.databind.module.SimpleModule getModule(com.fasterxml.jackson.databind.ObjectMapper mapper)
Gets a module wrapping this serializer as an adapter for the Jackson ObjectMapper.- Parameters:
mapper- the object mapper for default deserializations- Returns:
- a simple module to be plugged onto Jackson ObjectMapper.
-
deserializeWithType
public Object deserializeWithType(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext cxt, com.fasterxml.jackson.databind.jsontype.TypeDeserializer tDeserializer) throws IOException
- Overrides:
deserializeWithTypein classcom.fasterxml.jackson.databind.deser.std.StdDeserializer<Object>- Throws:
IOException
-
deserialize
public Object deserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext cxt) throws IOException
- Specified by:
deserializein classcom.fasterxml.jackson.databind.JsonDeserializer<Object>- Throws:
IOException
-
resolve
public void resolve(com.fasterxml.jackson.databind.DeserializationContext cxt) throws com.fasterxml.jackson.databind.JsonMappingException- Specified by:
resolvein interfacecom.fasterxml.jackson.databind.deser.ResolvableDeserializer- Throws:
com.fasterxml.jackson.databind.JsonMappingException
-
-