public class HibernateProxySerializer
extends com.fasterxml.jackson.databind.JsonSerializer<org.hibernate.proxy.HibernateProxy>
HibernateProxy
.
TODO: should try to make this work more like Jackson
BeanPropertyWriter
, possibly sub-classing
it -- it handles much of functionality we need, and has
access to more information than value serializers (like
this one) have.
Modifier and Type | Field and Description |
---|---|
protected com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap |
_dynamicSerializers
For efficient serializer lookup, let's use this; most
of the time, there's just one type and one serializer.
|
protected boolean |
_forceLazyLoading |
protected com.fasterxml.jackson.databind.BeanProperty |
_property
Property that has proxy value to handle
|
protected boolean |
_serializeIdentifier |
Constructor and Description |
---|
HibernateProxySerializer(boolean forceLazyLoading) |
HibernateProxySerializer(boolean forceLazyLoading,
boolean serializeIdentifier) |
Modifier and Type | Method and Description |
---|---|
protected Object |
findProxied(org.hibernate.proxy.HibernateProxy proxy)
Helper method for finding value being proxied, if it is available
or if it is to be forced to be loaded.
|
protected com.fasterxml.jackson.databind.JsonSerializer<Object> |
findSerializer(com.fasterxml.jackson.databind.SerializerProvider provider,
Object value) |
void |
serialize(org.hibernate.proxy.HibernateProxy value,
com.fasterxml.jackson.core.JsonGenerator jgen,
com.fasterxml.jackson.databind.SerializerProvider provider) |
void |
serializeWithType(org.hibernate.proxy.HibernateProxy value,
com.fasterxml.jackson.core.JsonGenerator jgen,
com.fasterxml.jackson.databind.SerializerProvider provider,
com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) |
protected final com.fasterxml.jackson.databind.BeanProperty _property
protected final boolean _forceLazyLoading
protected final boolean _serializeIdentifier
protected com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap _dynamicSerializers
public HibernateProxySerializer(boolean forceLazyLoading)
public HibernateProxySerializer(boolean forceLazyLoading, boolean serializeIdentifier)
public void serialize(org.hibernate.proxy.HibernateProxy 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<org.hibernate.proxy.HibernateProxy>
IOException
com.fasterxml.jackson.core.JsonProcessingException
public void serializeWithType(org.hibernate.proxy.HibernateProxy 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<org.hibernate.proxy.HibernateProxy>
IOException
com.fasterxml.jackson.core.JsonProcessingException
protected com.fasterxml.jackson.databind.JsonSerializer<Object> findSerializer(com.fasterxml.jackson.databind.SerializerProvider provider, Object value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
IOException
com.fasterxml.jackson.core.JsonProcessingException
protected Object findProxied(org.hibernate.proxy.HibernateProxy proxy)
Copyright © 2012-2013 FasterXML. All Rights Reserved.