Class ReadOnlyClassToSerializerMap
- java.lang.Object
-
- org.codehaus.jackson.map.ser.impl.ReadOnlyClassToSerializerMap
-
public final class ReadOnlyClassToSerializerMap extends java.lang.ObjectOptimized lookup table for accessing two types of serializers; typed and non-typed. Only accessed from a single thread, so no synchronization needed for accessors.- Since:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description protected SerializerCache.TypeKey_cacheKeyWe'll reuse key class to avoid unnecessary instantiations; since this is not shared between threads, we can just reuse single instance.protected JsonSerializerMap_mapActual mappings from type key to serializers
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ReadOnlyClassToSerializerMapfrom(java.util.HashMap<SerializerCache.TypeKey,JsonSerializer<java.lang.Object>> src)Factory method for creating the "blueprint" lookup map.ReadOnlyClassToSerializerMapinstance()JsonSerializer<java.lang.Object>typedValueSerializer(java.lang.Class<?> cls)JsonSerializer<java.lang.Object>typedValueSerializer(JavaType type)JsonSerializer<java.lang.Object>untypedValueSerializer(java.lang.Class<?> cls)JsonSerializer<java.lang.Object>untypedValueSerializer(JavaType type)
-
-
-
Field Detail
-
_map
protected final JsonSerializerMap _map
Actual mappings from type key to serializers
-
_cacheKey
protected final SerializerCache.TypeKey _cacheKey
We'll reuse key class to avoid unnecessary instantiations; since this is not shared between threads, we can just reuse single instance.
-
-
Method Detail
-
instance
public ReadOnlyClassToSerializerMap instance()
-
from
public static ReadOnlyClassToSerializerMap from(java.util.HashMap<SerializerCache.TypeKey,JsonSerializer<java.lang.Object>> src)
Factory method for creating the "blueprint" lookup map. Such map can not be used as is but just shared: to get an actual usable instance,instance()has to be called first.
-
typedValueSerializer
public JsonSerializer<java.lang.Object> typedValueSerializer(JavaType type)
-
typedValueSerializer
public JsonSerializer<java.lang.Object> typedValueSerializer(java.lang.Class<?> cls)
-
untypedValueSerializer
public JsonSerializer<java.lang.Object> untypedValueSerializer(java.lang.Class<?> cls)
-
untypedValueSerializer
public JsonSerializer<java.lang.Object> untypedValueSerializer(JavaType type)
-
-