public class PersistentCollectionSerializer extends com.fasterxml.jackson.databind.JsonSerializer<Object> implements com.fasterxml.jackson.databind.ser.ContextualSerializer
Collection
and Map
types (unlike in JDK).Modifier and Type | Field and Description |
---|---|
protected boolean |
_forceLazyLoading
Whether loading of values is forced for lazy references.
|
protected com.fasterxml.jackson.databind.JsonSerializer<Object> |
_serializer
Serializer that does actual value serialization when value
is available (either already or with forced access).
|
Constructor and Description |
---|
PersistentCollectionSerializer(boolean forceLazyLoading,
com.fasterxml.jackson.databind.JsonSerializer<?> serializer) |
Modifier and Type | Method and Description |
---|---|
com.fasterxml.jackson.databind.JsonSerializer<Object> |
createContextual(com.fasterxml.jackson.databind.SerializerProvider provider,
com.fasterxml.jackson.databind.BeanProperty property)
We need to resolve actual serializer once we know the context; specifically
must know type of property being serialized.
|
void |
serialize(Object value,
com.fasterxml.jackson.core.JsonGenerator jgen,
com.fasterxml.jackson.databind.SerializerProvider provider) |
void |
serializeWithType(Object value,
com.fasterxml.jackson.core.JsonGenerator jgen,
com.fasterxml.jackson.databind.SerializerProvider provider,
com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) |
protected boolean |
usesLazyLoading(com.fasterxml.jackson.databind.BeanProperty property)
Method called to see whether given property indicates it uses lazy
resolution of reference contained.
|
protected final boolean _forceLazyLoading
protected final com.fasterxml.jackson.databind.JsonSerializer<Object> _serializer
public PersistentCollectionSerializer(boolean forceLazyLoading, com.fasterxml.jackson.databind.JsonSerializer<?> serializer)
public com.fasterxml.jackson.databind.JsonSerializer<Object> createContextual(com.fasterxml.jackson.databind.SerializerProvider provider, com.fasterxml.jackson.databind.BeanProperty property) throws com.fasterxml.jackson.databind.JsonMappingException
createContextual
in interface com.fasterxml.jackson.databind.ser.ContextualSerializer
com.fasterxml.jackson.databind.JsonMappingException
public void serialize(Object value, com.fasterxml.jackson.core.JsonGenerator jgen, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
serialize
in class com.fasterxml.jackson.databind.JsonSerializer<Object>
IOException
com.fasterxml.jackson.core.JsonProcessingException
public void serializeWithType(Object value, com.fasterxml.jackson.core.JsonGenerator jgen, com.fasterxml.jackson.databind.SerializerProvider provider, com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
serializeWithType
in class com.fasterxml.jackson.databind.JsonSerializer<Object>
IOException
com.fasterxml.jackson.core.JsonProcessingException
protected boolean usesLazyLoading(com.fasterxml.jackson.databind.BeanProperty property)
Copyright © 2012-2013 FasterXML. All Rights Reserved.