Class PropertySerializerMap
- java.lang.Object
-
- org.codehaus.jackson.map.ser.impl.PropertySerializerMap
-
public abstract class PropertySerializerMap extends java.lang.Object
Helper container used for resolving serializers for dynamic (possibly but not necessarily polymorphic) properties: properties whose type is not forced to use dynamic (declared) type and that are not final. If so, serializer to use can only be established once actual value type is known. Since this happens a lot unless static typing is forced (or types are final) this implementation is optimized for efficiency. Instances are immutable; new instances are created with factory methods: this is important to ensure correct multi-threaded access.- Since:
- 1.7
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PropertySerializerMap.SerializerAndMapResult
Value class used for returning tuple that has both serializer that was retrieved and new map instance
-
Constructor Summary
Constructors Constructor Description PropertySerializerMap()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static PropertySerializerMap
emptyMap()
PropertySerializerMap.SerializerAndMapResult
findAndAddSerializer(java.lang.Class<?> type, SerializerProvider provider, BeanProperty property)
Method called if initial lookup fails; will both find serializer and construct new map instance if warranted, and return bothPropertySerializerMap.SerializerAndMapResult
findAndAddSerializer(JavaType type, SerializerProvider provider, BeanProperty property)
abstract PropertySerializerMap
newWith(java.lang.Class<?> type, JsonSerializer<java.lang.Object> serializer)
abstract JsonSerializer<java.lang.Object>
serializerFor(java.lang.Class<?> type)
Main lookup method.
-
-
-
Method Detail
-
serializerFor
public abstract JsonSerializer<java.lang.Object> serializerFor(java.lang.Class<?> type)
Main lookup method. Takes a "raw" type since usage is always from place where parameterization is fixed such that there can not be type-parametric variations.
-
findAndAddSerializer
public final PropertySerializerMap.SerializerAndMapResult findAndAddSerializer(java.lang.Class<?> type, SerializerProvider provider, BeanProperty property) throws JsonMappingException
Method called if initial lookup fails; will both find serializer and construct new map instance if warranted, and return both- Throws:
JsonMappingException
-
findAndAddSerializer
public final PropertySerializerMap.SerializerAndMapResult findAndAddSerializer(JavaType type, SerializerProvider provider, BeanProperty property) throws JsonMappingException
- Throws:
JsonMappingException
-
newWith
public abstract PropertySerializerMap newWith(java.lang.Class<?> type, JsonSerializer<java.lang.Object> serializer)
-
emptyMap
public static PropertySerializerMap emptyMap()
-
-