com.fasterxml.jackson.databind.deser.std

Class StdDeserializer<T>

    • Field Detail

      • _valueClass

        protected final Class<?> _valueClass
        Type of values this deserializer handles: sometimes exact types, other time most specific supertype of types deserializer handles (which may be as generic as Object in some case)
    • Constructor Detail

      • StdDeserializer

        protected StdDeserializer(Class<?> vc)
      • StdDeserializer

        protected StdDeserializer(JavaType valueType)
    • Method Detail

      • handledType

        public Class<?> handledType()
        Description copied from class: JsonDeserializer
        Method for accessing type of values this deserializer produces. Note that this information is not guaranteed to be exact -- it may be a more generic (super-type) -- but it should not be incorrect (return a non-related type).

        Default implementation will return null, which means almost same same as returning Object.class would; that is, that nothing is known about handled type.

        Overrides:
        handledType in class JsonDeserializer<T>
      • getValueType

        public JavaType getValueType()
        Exact structured type deserializer handles, if known.

        Default implementation just returns null.

      • isDefaultDeserializer

        protected boolean isDefaultDeserializer(JsonDeserializer<?> deserializer)
        Method that can be called to determine if given deserializer is the default deserializer Jackson uses; as opposed to a custom deserializer installed by a module or calling application. Determination is done using JacksonStdImpl annotation on deserializer class.
      • isDefaultKeyDeserializer

        protected boolean isDefaultKeyDeserializer(KeyDeserializer keyDeser)
      • deserializeWithType

        public Object deserializeWithType(com.fasterxml.jackson.core.JsonParser jp,
                                 DeserializationContext ctxt,
                                 TypeDeserializer typeDeserializer)
                                   throws IOException,
                                          com.fasterxml.jackson.core.JsonProcessingException
        Base implementation that does not assume specific type inclusion mechanism. Sub-classes are expected to override this method if they are to handle type information.
        Overrides:
        deserializeWithType in class JsonDeserializer<T>
        typeDeserializer - Deserializer to use for handling type information
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseBooleanPrimitive

        protected final boolean _parseBooleanPrimitive(com.fasterxml.jackson.core.JsonParser jp,
                                     DeserializationContext ctxt)
                                                throws IOException,
                                                       com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseBoolean

        protected final Boolean _parseBoolean(com.fasterxml.jackson.core.JsonParser jp,
                            DeserializationContext ctxt)
                                       throws IOException,
                                              com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseBooleanFromNumber

        protected final boolean _parseBooleanFromNumber(com.fasterxml.jackson.core.JsonParser jp,
                                      DeserializationContext ctxt)
                                                 throws IOException,
                                                        com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseByte

        protected Byte _parseByte(com.fasterxml.jackson.core.JsonParser jp,
                      DeserializationContext ctxt)
                           throws IOException,
                                  com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseShort

        protected Short _parseShort(com.fasterxml.jackson.core.JsonParser jp,
                        DeserializationContext ctxt)
                             throws IOException,
                                    com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseShortPrimitive

        protected final short _parseShortPrimitive(com.fasterxml.jackson.core.JsonParser jp,
                                 DeserializationContext ctxt)
                                            throws IOException,
                                                   com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseIntPrimitive

        protected final int _parseIntPrimitive(com.fasterxml.jackson.core.JsonParser jp,
                             DeserializationContext ctxt)
                                        throws IOException,
                                               com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseInteger

        protected final Integer _parseInteger(com.fasterxml.jackson.core.JsonParser jp,
                            DeserializationContext ctxt)
                                       throws IOException,
                                              com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseLong

        protected final Long _parseLong(com.fasterxml.jackson.core.JsonParser jp,
                      DeserializationContext ctxt)
                                 throws IOException,
                                        com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseLongPrimitive

        protected final long _parseLongPrimitive(com.fasterxml.jackson.core.JsonParser jp,
                               DeserializationContext ctxt)
                                          throws IOException,
                                                 com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseFloat

        protected final Float _parseFloat(com.fasterxml.jackson.core.JsonParser jp,
                        DeserializationContext ctxt)
                                   throws IOException,
                                          com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseFloatPrimitive

        protected final float _parseFloatPrimitive(com.fasterxml.jackson.core.JsonParser jp,
                                 DeserializationContext ctxt)
                                            throws IOException,
                                                   com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseDouble

        protected final Double _parseDouble(com.fasterxml.jackson.core.JsonParser jp,
                          DeserializationContext ctxt)
                                     throws IOException,
                                            com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseDoublePrimitive

        protected final double _parseDoublePrimitive(com.fasterxml.jackson.core.JsonParser jp,
                                   DeserializationContext ctxt)
                                              throws IOException,
                                                     com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • _parseDate

        protected Date _parseDate(com.fasterxml.jackson.core.JsonParser jp,
                      DeserializationContext ctxt)
                           throws IOException,
                                  com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
      • parseDouble

        protected static final double parseDouble(String numStr)
                                           throws NumberFormatException
        Helper method for encapsulating calls to low-level double value parsing; single place just because we need a work-around that must be applied to all calls.
        Throws:
        NumberFormatException
      • _parseString

        protected final String _parseString(com.fasterxml.jackson.core.JsonParser jp,
                          DeserializationContext ctxt)
                                     throws IOException,
                                            com.fasterxml.jackson.core.JsonProcessingException
        Helper method used for accessing String value, if possible, doing necessary conversion or throwing exception as necessary.
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException
        Since:
        2.1
      • _hasTextualNull

        protected boolean _hasTextualNull(String value)
        Helper method called to determine if we are seeing String value of "null", and, further, that it should be coerced to null just like null token.
        Since:
        2.3
      • findDeserializer

        protected JsonDeserializer<Object> findDeserializer(DeserializationContext ctxt,
                                                JavaType type,
                                                BeanProperty property)
                                                     throws JsonMappingException
        Helper method used to locate deserializers for properties the type this deserializer handles contains (usually for properties of bean types)
        Parameters:
        type - Type of property to deserialize
        property - Actual property object (field, method, constuctor parameter) used for passing deserialized values; provided so deserializer can be contextualized if necessary (since 1.7)
        Throws:
        JsonMappingException
      • findConvertingContentDeserializer

        protected JsonDeserializer<?> findConvertingContentDeserializer(DeserializationContext ctxt,
                                                            BeanProperty prop,
                                                            JsonDeserializer<?> existingDeserializer)
                                                                 throws JsonMappingException
        Helper method that can be used to see if specified property has annotation indicating that a converter is to be used for contained values (contents of structured types; array/List/Map values)
        Parameters:
        existingDeserializer - (optional) configured content serializer if one already exists.
        Throws:
        JsonMappingException
        Since:
        2.2
      • handleUnknownProperty

        protected void handleUnknownProperty(com.fasterxml.jackson.core.JsonParser jp,
                                 DeserializationContext ctxt,
                                 Object instanceOrClass,
                                 String propName)
                                      throws IOException,
                                             com.fasterxml.jackson.core.JsonProcessingException
        Method called to deal with a property that did not map to a known Bean property. Method can deal with the problem as it sees fit (ignore, throw exception); but if it does return, it has to skip the matching Json content parser has.

        NOTE: method signature was changed in version 1.5; explicit JsonParser must be passed since it may be something other than what context has. Prior versions did not include the first parameter.

        Parameters:
        jp - Parser that points to value of the unknown property
        ctxt - Context for deserialization; allows access to the parser, error reporting functionality
        instanceOrClass - Instance that is being populated by this deserializer, or if not known, Class that would be instantiated. If null, will assume type is what getValueClass() returns.
        propName - Name of the property that can not be mapped
        Throws:
        IOException
        com.fasterxml.jackson.core.JsonProcessingException

Copyright © 2012-2013 FasterXML. All Rights Reserved.