Class DeserializationConfig

  • All Implemented Interfaces:
    ClassIntrospector.MixInResolver, java.io.Serializable

    public final class DeserializationConfig
    extends MapperConfigBase<DeserializationFeature,​DeserializationConfig>
    implements java.io.Serializable
    Object that contains baseline configuration for deserialization process. An instance is owned by ObjectMapper, which passes an immutable instance to be used for deserialization process.

    Note that instances are considered immutable and as such no copies should need to be created for sharing; all copying is done with "fluent factory" methods.

    See Also:
    Serialized Form
    • Field Detail

      • DESER_FEATURE_DEFAULTS

        private static final int DESER_FEATURE_DEFAULTS
      • _problemHandlers

        protected final LinkedNode<DeserializationProblemHandler> _problemHandlers
        Linked list that contains all registered problem handlers. Implementation as front-added linked list allows for sharing of the list (tail) without copying the list.
      • _parserFeatures

        protected final int _parserFeatures
        States of JsonParser.Features to enable/disable.
      • _parserFeaturesToChange

        protected final int _parserFeaturesToChange
        Bitflag of JsonParser.Features to enable/disable
      • _formatReadFeatures

        protected final int _formatReadFeatures
        States of FormatFeatures to enable/disable.
        Since:
        2.7
      • _formatReadFeaturesToChange

        protected final int _formatReadFeaturesToChange
        Bitflag of FormatFeatures to enable/disable
        Since:
        2.7
    • Method Detail

      • getBaseSettings

        protected BaseSettings getBaseSettings()
      • withRootName

        public DeserializationConfig withRootName​(PropertyName rootName)
        Description copied from class: MapperConfigBase
        Method for constructing and returning a new instance with different root name to use (none, if null).

        Note that when a root name is set to a non-Empty String, this will automatically force use of root element wrapping with given name. If empty String passed, will disable root name wrapping; and if null used, will instead use SerializationFeature to determine if to use wrapping, and annotation (or default name) for actual root name to use.

        Specified by:
        withRootName in class MapperConfigBase<DeserializationFeature,​DeserializationConfig>
        Parameters:
        rootName - to use: if null, means "use default" (clear setting); if empty String ("") means that no root name wrapping is used; otherwise defines root name to use.
      • withFeatures

        public DeserializationConfig withFeatures​(DeserializationFeature... features)
        Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
      • withoutFeatures

        public DeserializationConfig withoutFeatures​(DeserializationFeature... features)
        Fluent factory method that will construct and return a new configuration object instance with specified features disabled.
      • with

        public DeserializationConfig with​(com.fasterxml.jackson.core.JsonParser.Feature feature)
        Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
        Since:
        2.5
      • withFeatures

        public DeserializationConfig withFeatures​(com.fasterxml.jackson.core.JsonParser.Feature... features)
        Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
        Since:
        2.5
      • without

        public DeserializationConfig without​(com.fasterxml.jackson.core.JsonParser.Feature feature)
        Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.
        Since:
        2.5
      • withoutFeatures

        public DeserializationConfig withoutFeatures​(com.fasterxml.jackson.core.JsonParser.Feature... features)
        Fluent factory method that will construct and return a new configuration object instance with specified features disabled.
        Since:
        2.5
      • with

        public DeserializationConfig with​(com.fasterxml.jackson.core.FormatFeature feature)
        Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
        Since:
        2.7
      • withFeatures

        public DeserializationConfig withFeatures​(com.fasterxml.jackson.core.FormatFeature... features)
        Fluent factory method that will construct and return a new configuration object instance with specified features enabled.
        Since:
        2.7
      • without

        public DeserializationConfig without​(com.fasterxml.jackson.core.FormatFeature feature)
        Fluent factory method that will construct and return a new configuration object instance with specified feature disabled.
        Since:
        2.7
      • withoutFeatures

        public DeserializationConfig withoutFeatures​(com.fasterxml.jackson.core.FormatFeature... features)
        Fluent factory method that will construct and return a new configuration object instance with specified features disabled.
        Since:
        2.7
      • _withJsonReadFeatures

        private DeserializationConfig _withJsonReadFeatures​(com.fasterxml.jackson.core.FormatFeature... features)
      • _withoutJsonReadFeatures

        private DeserializationConfig _withoutJsonReadFeatures​(com.fasterxml.jackson.core.FormatFeature... features)
      • withNoProblemHandlers

        public DeserializationConfig withNoProblemHandlers()
        Method for removing all configured problem handlers; usually done to replace existing handler(s) with different one(s)
      • initialize

        public void initialize​(com.fasterxml.jackson.core.JsonParser p)
        Method called by ObjectMapper and ObjectReader to modify those JsonParser.Feature settings that have been configured via this config instance.
        Since:
        2.5
      • useRootWrapping

        public boolean useRootWrapping()
        Description copied from class: MapperConfig
        Accessor for checking whether configuration indicates that "root wrapping" (use of an extra property/name pair at root level) is expected or not.
        Specified by:
        useRootWrapping in class MapperConfig<DeserializationConfig>
      • isEnabled

        public final boolean isEnabled​(com.fasterxml.jackson.core.JsonParser.Feature f,
                                       com.fasterxml.jackson.core.JsonFactory factory)
      • hasDeserializationFeatures

        public final boolean hasDeserializationFeatures​(int featureMask)
        Bulk access method for checking that all features specified by mask are enabled.
        Since:
        2.3
      • hasSomeOfFeatures

        public final boolean hasSomeOfFeatures​(int featureMask)
        Bulk access method for checking that at least one of features specified by mask is enabled.
        Since:
        2.6
      • getDeserializationFeatures

        public final int getDeserializationFeatures()
        Bulk access method for getting the bit mask of all DeserializationFeatures that are enabled.
      • requiresFullValue

        public final boolean requiresFullValue()
        Convenience method equivalant to: isEnabled(DeserializationFeature.FAIL_ON_TRAILING_TOKENS)
        Since:
        2.9
      • introspect

        public <T extends BeanDescription> T introspect​(JavaType type)
        Method that will introspect full bean properties for the purpose of building a bean deserializer
        Parameters:
        type - Type of class to be introspected
      • introspectForCreation

        public <T extends BeanDescription> T introspectForCreation​(JavaType type)
        Method that will introspect subset of bean properties needed to construct bean instance.