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 org.hibernate.engine.spi.Mapping |
_mapping |
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) |
HibernateProxySerializer(boolean forceLazyLoading,
boolean serializeIdentifier,
org.hibernate.engine.spi.Mapping mapping) |
| 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) |
boolean |
isEmpty(org.hibernate.proxy.HibernateProxy 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 final org.hibernate.engine.spi.Mapping _mapping
protected com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap _dynamicSerializers
public HibernateProxySerializer(boolean forceLazyLoading)
public HibernateProxySerializer(boolean forceLazyLoading,
boolean serializeIdentifier)
public HibernateProxySerializer(boolean forceLazyLoading,
boolean serializeIdentifier,
org.hibernate.engine.spi.Mapping mapping)
public boolean isEmpty(org.hibernate.proxy.HibernateProxy value)
isEmpty in class com.fasterxml.jackson.databind.JsonSerializer<org.hibernate.proxy.HibernateProxy>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>IOExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionpublic 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>IOExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionprotected com.fasterxml.jackson.databind.JsonSerializer<Object> findSerializer(com.fasterxml.jackson.databind.SerializerProvider provider, Object value) throws IOException, com.fasterxml.jackson.core.JsonProcessingException
IOExceptioncom.fasterxml.jackson.core.JsonProcessingExceptionprotected Object findProxied(org.hibernate.proxy.HibernateProxy proxy)
Copyright © 2012-2014 FasterXML. All Rights Reserved.