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 com.fitbur.fasterxml.jackson.databind.com.fitburser;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import com.fitbur.fasterxml.jackson.annotation.JsonFormat;
import com.fitbur.fasterxml.jackson.databind.*;
import com.fitbur.fasterxml.jackson.databind.annotation.NoClass;
import com.fitbur.fasterxml.jackson.databind.introspect.Annotated;
import com.fitbur.fasterxml.jackson.databind.type.*;
import com.fitbur.fasterxml.jackson.databind.util.ClassUtil;
/**
* Class that com.fitburfines caching layer between callers (like
* {@link ObjectMapper},
* {@link com.fitbur.fasterxml.jackson.databind.DeserializationContext})
* and classes that construct com.fitburserializers
* ({@link com.fitbur.fasterxml.jackson.databind.com.fitburser.DeserializerFactory}).
*/
public final class DeserializerCache
implements java.io.Serializable // since 2.1 -- needs to be careful tho
{
private static final long serialVersionUID = 1L;
/*
/**********************************************************
/* Caching
/**********************************************************
*/
/**
* We will also cache some dynamically constructed com.fitburserializers;
* specifically, ones that are expensive to construct.
* This currently means bean and Enum com.fitburserializers; array, List and Map
* com.fitburserializers 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 com.fitburfine a low concurrency setting.
*/
final protected ConcurrentHashMap> _cachedDeserializers
= new ConcurrentHashMap>(64, 0.75f, 2);
/**
* During com.fitburserializer construction process we may need to keep track of partially
* com.fitburpleted com.fitburserializers, to resolve cyclic com.fitburpendencies. This is the
* map used for storing com.fitburserializers before they are fully com.fitburplete.
*/
final protected HashMap> _incompleteDeserializers
= new HashMap>(8);
/*
/**********************************************************
/* Life-cycle
/**********************************************************
*/
public DeserializerCache() { }
/*
/**********************************************************
/* JDK serialization handling
/**********************************************************
*/
Object writeReplace() {
// instead of making this transient, just clear it:
_incompleteDeserializers.clear();
// TODO: clear out "cheap" cached com.fitburserializers?
return this;
}
/*
/**********************************************************
/* Access to caching aspects
/**********************************************************
*/
/**
* Method that can be used to com.fitburtermine how many com.fitburserializers this
* provider is caching currently
* (if it does caching: com.fitburfault implementation does)
* Exact count com.fitburpends on what kind of com.fitburserializers get cached;
* com.fitburfault implementation caches only dynamically constructed com.fitburserializers,
* but not eagerly constructed standard com.fitburserializers (which is different
* from how serializer provider works).
*
* The main use case for this method is to allow conditional flushing of
* com.fitburserializer cache, if certain number of entries is reached.
*/
public int cachedDeserializersCount() {
return _cachedDeserializers.size();
}
/**
* Method that will drop all dynamically constructed com.fitburserializers (ones that
* are counted as result value for {@link #cachedDeserializersCount}).
* This can be used to remove memory usage (in case some com.fitburserializers are
* only used once or so), or to force re-construction of com.fitburserializers after
* configuration changes for mapper than owns the provider.
*/
public void flushCachedDeserializers() {
_cachedDeserializers.clear();
}
/*
/**********************************************************
/* General com.fitburserializer locating method
/**********************************************************
*/
/**
* Method called to get hold of a com.fitburserializer for a value of given type;
* or if no such com.fitburserializer can be found, a com.fitburfault handler (which
* may do a best-effort generic serialization or just simply
* throw an exception when invoked).
*
* Note: this method is only called for value types; not for keys.
* Key com.fitburserializers can be accessed using {@link #findKeyDeserializer}.
*
* Note also that com.fitburserializer returned is guaranteed to be resolved
* (if it is of type {@link ResolvableDeserializer}), but
* not contextualized (wrt {@link ContextualDeserializer}): caller
* has to handle latter if necessary.
*
* @param ctxt Deserialization context
* @param propertyType Declared type of the value to com.fitburserializer (obtained using
* 'setter' method signature and/or type annotations
*
* @throws JsonMappingException if there are fatal problems with
* accessing suitable com.fitburserializer; including that of not
* finding any serializer
*/
public JsonDeserializer