Package com.anaptecs.jeaf.json.impl
Class AbstractDeserializer<T>
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonDeserializer<T>
-
- com.fasterxml.jackson.databind.deser.std.StdDeserializer<T>
-
- com.anaptecs.jeaf.json.impl.AbstractDeserializer<T>
-
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider,com.fasterxml.jackson.databind.deser.ValueInstantiator.Gettable,java.io.Serializable
public abstract class AbstractDeserializer<T> extends com.fasterxml.jackson.databind.deser.std.StdDeserializer<T>Class implements a base class that can be used to implement JSON deserializers.- Author:
- JEAF Development Team
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDeserializer(java.lang.Class<?> pType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tdeserialize(com.fasterxml.jackson.core.JsonParser pParser, com.fasterxml.jackson.databind.DeserializationContext pContext)Method reads version info data from the JSON data and creates aVersionInfoobject out of it.abstract Tdeserialize(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode)Method deserializes the passed JSONObjectNodeinto its matching "real" object.protected java.math.BigDecimalgetBigDecimalValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.math.BigDecimal pDefaultValue)Method returns theBigDecimalvalue from the field with the passed name from the passed JSON node.protected java.math.BigIntegergetBigIntegerValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.math.BigInteger pDefaultValue)Method returns theBigIntegervalue from the field with the passed name from the passed JSON node.protected booleangetBooleanValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, boolean pDefaultValue)Method returns the boolean value from the field with the passed name from the passed JSON node.protected java.lang.BooleangetBooleanValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Boolean pDefaultValue)Method returns theBooleanvalue from the field with the passed name from the passed JSON node.protected bytegetByteValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, byte pDefaultValue)Method returns the byte value from the field with the passed name from the passed JSON node.protected java.lang.BytegetByteValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Byte pDefaultValue)Method returns theBytevalue from the field with the passed name from the passed JSON node.protected java.util.CalendargetCalendarValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.util.Calendar pDefaultValue)Method returns theCalendarvalue from the field with the passed name from the passed JSON node.protected java.util.DategetDateValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.util.Date pDefaultValue)Method returns theDatevalue from the field with the passed name from the passed JSON node.protected doublegetDoubleValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, double pDefaultValue)Method returns the double value from the field with the passed name from the passed JSON node.protected java.lang.DoublegetDoubleValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Double pDefaultValue)Method returns theDoublevalue from the field with the passed name from the passed JSON node.protected floatgetFloatValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, float pDefaultValue)Method returns the float value from the field with the passed name from the passed JSON node.protected java.lang.FloatgetFloatValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Float pDefaultValue)Method returns theFloatvalue from the field with the passed name from the passed JSON node.protected intgetIntegerValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, int pDefaultValue)Method returns the int value from the field with the passed name from the passed JSON node.protected java.lang.IntegergetIntegerValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Integer pDefaultValue)Method returns theIntegervalue from the field with the passed name from the passed JSON node.protected longgetLongValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, long pDefaultValue)Method returns the long value from the field with the passed name from the passed JSON node.protected java.lang.LonggetLongValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Long pDefaultValue)Method returns theLongvalue from the field with the passed name from the passed JSON node.protected shortgetShortValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, short pDefaultValue)Method returns the short value from the field with the passed name from the passed JSON node.protected java.lang.ShortgetShortValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Short pDefaultValue)Method returns theShortvalue from the field with the passed name from the passed JSON node.protected java.lang.StringgetStringValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.String pDefaultValue)Method returns theStringvalue from the field with the passed name from the passed JSON node.-
Methods inherited from class com.fasterxml.jackson.databind.deser.std.StdDeserializer
_byteOverflow, _checkCoercionFail, _checkDoubleSpecialValue, _checkFloatSpecialValue, _checkFloatToIntCoercion, _checkFromStringCoercion, _checkFromStringCoercion, _checkTextualNull, _coerceBooleanFromInt, _coercedTypeDesc, _coerceEmptyString, _coerceIntegral, _coerceNullToken, _coerceTextualNull, _deserializeFromArray, _deserializeFromEmpty, _deserializeFromEmptyString, _deserializeFromString, _deserializeWrappedValue, _failDoubleToIntCoercion, _findCoercionFromBlankString, _findCoercionFromEmptyArray, _findCoercionFromEmptyString, _findNullProvider, _hasTextualNull, _intOverflow, _isBlank, _isEmptyOrTextualNull, _isFalse, _isIntNumber, _isNaN, _isNegInf, _isPosInf, _isTrue, _neitherNull, _nonNullNumber, _parseBoolean, _parseBooleanFromInt, _parseBooleanPrimitive, _parseBooleanPrimitive, _parseBytePrimitive, _parseDate, _parseDate, _parseDateFromArray, _parseDouble, _parseDoublePrimitive, _parseDoublePrimitive, _parseFloatPrimitive, _parseFloatPrimitive, _parseInteger, _parseInteger, _parseIntPrimitive, _parseIntPrimitive, _parseLong, _parseLong, _parseLongPrimitive, _parseLongPrimitive, _parseShortPrimitive, _parseString, _reportFailedNullCoerce, _shortOverflow, _verifyEndArrayForSingle, _verifyNullForPrimitive, _verifyNullForPrimitiveCoercion, _verifyNullForScalarCoercion, _verifyNumberForScalarCoercion, _verifyStringForScalarCoercion, deserializeWithType, findContentNullProvider, findContentNullStyle, findConvertingContentDeserializer, findDeserializer, findFormatFeature, findFormatOverrides, findValueNullProvider, getValueClass, getValueInstantiator, getValueType, getValueType, handledType, handleMissingEndArrayForSingle, handleUnknownProperty, isDefaultDeserializer, isDefaultKeyDeserializer
-
Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
-
-
-
Method Detail
-
deserialize
public final T deserialize(com.fasterxml.jackson.core.JsonParser pParser, com.fasterxml.jackson.databind.DeserializationContext pContext) throws com.fasterxml.jackson.core.JacksonException, java.io.IOException
Method reads version info data from the JSON data and creates aVersionInfoobject out of it.- Specified by:
deserializein classcom.fasterxml.jackson.databind.JsonDeserializer<T>- Parameters:
pParser- JSON parser. The parameter must not be null.pContext- Context information. The parameter is not used by this implementation.- Throws:
com.fasterxml.jackson.core.JacksonExceptionjava.io.IOException
-
deserialize
public abstract T deserialize(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode)
Method deserializes the passed JSONObjectNodeinto its matching "real" object.- Parameters:
pObjectNode- JSON data that should be converted into an real object. The parameter must not be null.- Returns:
- T Real object that was created using JSON data. The method may return null.
-
getStringValueFromNode
protected final java.lang.String getStringValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.String pDefaultValue)Method returns theStringvalue from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null. The parameter may be null.- Returns:
StringValue of the passed field or its default value.
-
getDateValueFromNode
protected final java.util.Date getDateValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.util.Date pDefaultValue)Method returns theDatevalue from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null. The parameter may be null.- Returns:
DateValue of the passed field or its default value.
-
getCalendarValueFromNode
protected final java.util.Calendar getCalendarValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.util.Calendar pDefaultValue)Method returns theCalendarvalue from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null. The parameter may be null.- Returns:
CalendarValue of the passed field or its default value.
-
getBooleanValueFromNode
protected final boolean getBooleanValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, boolean pDefaultValue)Method returns the boolean value from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null.- Returns:
- boolean Value of the passed field or its default value.
-
getBooleanValueFromNode
protected final java.lang.Boolean getBooleanValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Boolean pDefaultValue)Method returns theBooleanvalue from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null. The parameter may be null.- Returns:
BooleanValue of the passed field or its default value.
-
getByteValueFromNode
protected final byte getByteValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, byte pDefaultValue)Method returns the byte value from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null.- Returns:
- byte Value of the passed field or its default value.
-
getByteValueFromNode
protected final java.lang.Byte getByteValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Byte pDefaultValue)Method returns theBytevalue from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null. The parameter may be null.- Returns:
ByteValue of the passed field or its default value.
-
getShortValueFromNode
protected final short getShortValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, short pDefaultValue)Method returns the short value from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null.- Returns:
- byte Value of the passed field or its default value.
-
getShortValueFromNode
protected final java.lang.Short getShortValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Short pDefaultValue)Method returns theShortvalue from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null. The parameter may be null.- Returns:
ShortValue of the passed field or its default value.
-
getIntegerValueFromNode
protected final int getIntegerValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, int pDefaultValue)Method returns the int value from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null.- Returns:
- int Value of the passed field or its default value.
-
getIntegerValueFromNode
protected final java.lang.Integer getIntegerValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Integer pDefaultValue)Method returns theIntegervalue from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null. The parameter may be null.- Returns:
IntegerValue of the passed field or its default value.
-
getLongValueFromNode
protected final long getLongValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, long pDefaultValue)Method returns the long value from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null.- Returns:
- long Value of the passed field or its default value.
-
getLongValueFromNode
protected final java.lang.Long getLongValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Long pDefaultValue)Method returns theLongvalue from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null. The parameter may be null.- Returns:
LongValue of the passed field or its default value.
-
getBigIntegerValueFromNode
protected final java.math.BigInteger getBigIntegerValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.math.BigInteger pDefaultValue)Method returns theBigIntegervalue from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null. The parameter may be null.- Returns:
BigIntegerValue of the passed field or its default value.
-
getFloatValueFromNode
protected final float getFloatValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, float pDefaultValue)Method returns the float value from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null.- Returns:
- long float of the passed field or its default value.
-
getFloatValueFromNode
protected final java.lang.Float getFloatValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Float pDefaultValue)Method returns theFloatvalue from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null. The parameter may be null.- Returns:
FloatValue of the passed field or its default value.
-
getDoubleValueFromNode
protected final double getDoubleValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, double pDefaultValue)Method returns the double value from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null.- Returns:
- long float of the passed field or its default value.
-
getDoubleValueFromNode
protected final java.lang.Double getDoubleValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.lang.Double pDefaultValue)Method returns theDoublevalue from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null. The parameter may be null.- Returns:
DoubleValue of the passed field or its default value.
-
getBigDecimalValueFromNode
protected final java.math.BigDecimal getBigDecimalValueFromNode(com.fasterxml.jackson.databind.node.ObjectNode pObjectNode, java.lang.String pFieldName, java.math.BigDecimal pDefaultValue)Method returns theBigDecimalvalue from the field with the passed name from the passed JSON node.- Parameters:
pObjectNode- Node from which the field should be read. The parameter must not be null.pFieldName- Name of the field from which the value should be read. The parameter must not be null.pDefaultValue- Default value that should be used in case that the field is not present or null. The parameter may be null.- Returns:
BigDecimalValue of the passed field or its default value.
-
-