![JAR search and dependency download from the Maven repository](/logo.png)
org.codehaus.jackson.map.deser.StdDeserializerProvider Maven / Gradle / Ivy
Go to download
Data Mapper package is a high-performance data binding package
built on Jackson JSON processor
package org.codehaus.jackson.map.deser;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import org.codehaus.jackson.map.DeserializerFactory;
import org.codehaus.jackson.map.DeserializerProvider;
import org.codehaus.jackson.map.JsonDeserializer;
import org.codehaus.jackson.map.KeyDeserializer;
import org.codehaus.jackson.map.ResolvableDeserializer;
import org.codehaus.jackson.map.type.*;
/**
* Default {@link DeserializerProvider} implementation.
* Handles low-level caching (non-root) aspects of deserializer
* handling; all construction details are delegated to given
* {@link DeserializerFactory} instance.
*/
public class StdDeserializerProvider
extends DeserializerProvider
{
final static JavaType _typeObject = TypeFactory.instance.fromClass(Object.class);
final static JavaType _typeString = TypeFactory.instance.fromClass(String.class);
/*
////////////////////////////////////////////////////
// Caching
////////////////////////////////////////////////////
*/
/**
* We will pre-create serializers for common non-structured
* (that is things other than Collection, Map or array)
* types. These need not go through factory.
*/
final static HashMap> _simpleDeserializers = StdDeserializers.constructAll();
/**
* Similarly, key deserializers are only for simple types.
*/
final static HashMap _keyDeserializers = StdKeyDeserializers.constructAll();
/**
* We will also cache some dynamically constructed deserializers;
* specifically, ones that are expensive to construct.
* This currently means bean and Enum deserializers; array, List and Map
* deserializers will not be cached.
*
* Given that we don't expect much concurrency for additions
* (should very quickly converge to zero after startup), let's
* explicitly define a low concurrency setting.
*/
final protected ConcurrentHashMap> _cachedDeserializers
= new ConcurrentHashMap>(64, 0.75f, 2);
/*
////////////////////////////////////////////////////
// Life-cycle
////////////////////////////////////////////////////
*/
public StdDeserializerProvider() { }
/*
////////////////////////////////////////////////////
// Abstract methods impls
////////////////////////////////////////////////////
*/
@Override
public JsonDeserializer
© 2015 - 2025 Weber Informatics LLC | Privacy Policy