public final class ReadOnlyClassToSerializerMap extends Object
Modifier and Type | Field and Description |
---|---|
protected 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.
|
protected JsonSerializerMap |
_map
Actual mappings from type key to serializers
|
Modifier and Type | Method and Description |
---|---|
static ReadOnlyClassToSerializerMap |
from(HashMap<SerializerCache.TypeKey,JsonSerializer<Object>> src)
Factory method for creating the "blueprint" lookup map.
|
ReadOnlyClassToSerializerMap |
instance() |
JsonSerializer<Object> |
typedValueSerializer(Class<?> cls) |
JsonSerializer<Object> |
typedValueSerializer(JavaType type) |
JsonSerializer<Object> |
untypedValueSerializer(Class<?> cls) |
JsonSerializer<Object> |
untypedValueSerializer(JavaType type) |
protected final JsonSerializerMap _map
protected final SerializerCache.TypeKey _cacheKey
public ReadOnlyClassToSerializerMap instance()
public static ReadOnlyClassToSerializerMap from(HashMap<SerializerCache.TypeKey,JsonSerializer<Object>> src)
instance()
has to be called first.public JsonSerializer<Object> typedValueSerializer(JavaType type)
public JsonSerializer<Object> typedValueSerializer(Class<?> cls)
public JsonSerializer<Object> untypedValueSerializer(Class<?> cls)
public JsonSerializer<Object> untypedValueSerializer(JavaType type)