Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package org.codehaus.jackson.map.deser;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.io.SerializedString;
import org.codehaus.jackson.map.*;
import org.codehaus.jackson.map.deser.BeanDeserializer;
import org.codehaus.jackson.map.introspect.AnnotatedClass;
import org.codehaus.jackson.map.type.*;
import org.codehaus.jackson.map.util.ClassUtil;
import org.codehaus.jackson.map.util.RootNameLookup;
import org.codehaus.jackson.type.JavaType;
/**
* Default {@link DeserializerProvider} implementation.
* Handles low-level caching (non-root) aspects of deserializer
* handling; all construction details are delegated to configured
* {@link DeserializerFactory} instance that the provider owns.
*/
public class StdDeserializerProvider
extends DeserializerProvider
{
/*
/**********************************************************
/* Caching
/**********************************************************
*/
/**
* 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);
/**
* During deserializer construction process we may need to keep track of partially
* completed deserializers, to resolve cyclic dependencies. This is the
* map used for storing deserializers before they are fully complete.
*/
final protected HashMap> _incompleteDeserializers
= new HashMap>(8);
final protected RootNameLookup _rootNames;
/*
/**********************************************************
/* Configuration
/**********************************************************
*/
/**
* Factory responsible for constructing actual deserializers, if not
* one of pre-configured types.
*/
protected DeserializerFactory _factory;
/*
/**********************************************************
/* Life-cycle
/**********************************************************
*/
/**
* Default constructor. Equivalent to calling
*
* new StdDeserializerProvider(BeanDeserializerFactory.instance);
*
*/
public StdDeserializerProvider() { this(BeanDeserializerFactory.instance); }
public StdDeserializerProvider(DeserializerFactory f) {
_factory = f;
_rootNames = new RootNameLookup();
}
@Override
public DeserializerProvider withAdditionalDeserializers(Deserializers d) {
return withFactory(_factory.withAdditionalDeserializers(d));
}
@Override
public DeserializerProvider withAdditionalKeyDeserializers(KeyDeserializers d) {
return withFactory(_factory.withAdditionalKeyDeserializers(d));
}
@Override
public DeserializerProvider withDeserializerModifier(BeanDeserializerModifier modifier) {
return withFactory(_factory.withDeserializerModifier(modifier));
}
@Override
public DeserializerProvider withAbstractTypeResolver(AbstractTypeResolver resolver) {
return withFactory(_factory.withAbstractTypeResolver(resolver));
}
@Override
public DeserializerProvider withValueInstantiators(ValueInstantiators instantiators) {
return withFactory(_factory.withValueInstantiators(instantiators));
}
@Override
public StdDeserializerProvider withFactory(DeserializerFactory factory) {
// sanity-check to try to prevent hard-to-debug problems; sub-classes MUST override this method
if (this.getClass() != StdDeserializerProvider.class) {
throw new IllegalStateException("DeserializerProvider of type "
+this.getClass().getName()+" does not override 'withFactory()' method");
}
return new StdDeserializerProvider(factory);
}
/*
/**********************************************************
/* Abstract methods impls
/**********************************************************
*/
@Override
public JavaType mapAbstractType(DeserializationConfig config, JavaType type)
throws JsonMappingException
{
return _factory.mapAbstractType(config, type);
}
@Override
public SerializedString findExpectedRootName(DeserializationConfig config, JavaType type)
throws JsonMappingException
{
return _rootNames.findRootName(type, config);
}
@SuppressWarnings("unchecked")
@Override
public JsonDeserializer