public final class SerializerCache extends Object
Since version 1.5 cache will actually contain three kinds of entries, based on combination of class pair key. First class in key is for the type to serialize, and second one is type used for determining how to resolve value type. One (but not both) of entries can be null.
Modifier and Type | Class and Description |
---|---|
static class |
SerializerCache.TypeKey
Key that offers two "modes"; one with raw class, as used for
cases were raw class type is available (for example, when using
runtime type); and one with full generics-including.
|
Constructor and Description |
---|
SerializerCache() |
Modifier and Type | Method and Description |
---|---|
void |
addAndResolveNonTypedSerializer(Class<?> type,
JsonSerializer<Object> ser,
SerializerProvider provider) |
void |
addAndResolveNonTypedSerializer(JavaType type,
JsonSerializer<Object> ser,
SerializerProvider provider) |
void |
addTypedSerializer(Class<?> cls,
JsonSerializer<Object> ser) |
void |
addTypedSerializer(JavaType type,
JsonSerializer<Object> ser)
Method called if none of lookups succeeded, and caller had to construct
a serializer.
|
void |
flush()
Method called by StdSerializerProvider#flushCachedSerializers() to
clear all cached serializers
|
ReadOnlyClassToSerializerMap |
getReadOnlyLookupMap()
Method that can be called to get a read-only instance populated from the
most recent version of the shared lookup Map.
|
int |
size() |
JsonSerializer<Object> |
typedValueSerializer(Class<?> cls) |
JsonSerializer<Object> |
typedValueSerializer(JavaType type) |
JsonSerializer<Object> |
untypedValueSerializer(Class<?> type)
Method that checks if the shared (and hence, synchronized) lookup Map might have
untyped serializer for given type.
|
JsonSerializer<Object> |
untypedValueSerializer(JavaType type) |
public ReadOnlyClassToSerializerMap getReadOnlyLookupMap()
public int size()
public JsonSerializer<Object> untypedValueSerializer(Class<?> type)
public JsonSerializer<Object> untypedValueSerializer(JavaType type)
public JsonSerializer<Object> typedValueSerializer(JavaType type)
public JsonSerializer<Object> typedValueSerializer(Class<?> cls)
public void addTypedSerializer(JavaType type, JsonSerializer<Object> ser)
public void addTypedSerializer(Class<?> cls, JsonSerializer<Object> ser)
public void addAndResolveNonTypedSerializer(Class<?> type, JsonSerializer<Object> ser, SerializerProvider provider) throws JsonMappingException
JsonMappingException
public void addAndResolveNonTypedSerializer(JavaType type, JsonSerializer<Object> ser, SerializerProvider provider) throws JsonMappingException
JsonMappingException
public void flush()
Copyright © 2012-2014 FasterXML. All Rights Reserved.