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<?> |
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.
|
protected Object |
findLazyValue(org.hibernate.collection.spi.PersistentCollection coll) |
boolean |
isEmpty(Object value) |
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<?> 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.ContextualSerializercom.fasterxml.jackson.databind.JsonMappingExceptionpublic boolean isEmpty(Object value)
isEmpty in class com.fasterxml.jackson.databind.JsonSerializer<Object>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>IOExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionpublic 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>IOExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionprotected Object findLazyValue(org.hibernate.collection.spi.PersistentCollection coll)
protected boolean usesLazyLoading(com.fasterxml.jackson.databind.BeanProperty property)
Copyright © 2012-2014 FasterXML. All Rights Reserved.