org.codehaus.jackson.map.ser.impl
Class UnwrappingBeanPropertyWriter

java.lang.Object
  extended by org.codehaus.jackson.map.ser.BeanPropertyWriter
      extended by org.codehaus.jackson.map.ser.impl.UnwrappingBeanPropertyWriter
All Implemented Interfaces:
BeanProperty, Named

public class UnwrappingBeanPropertyWriter
extends BeanPropertyWriter

Variant of BeanPropertyWriter which will handle unwrapping of JSON Object (including of properties of Object within surrounding JSON object, and not as sub-object).

Since:
1.9

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.codehaus.jackson.map.BeanProperty
BeanProperty.Std
 
Field Summary
 
Fields inherited from class org.codehaus.jackson.map.ser.BeanPropertyWriter
_accessorMethod, _cfgSerializationType, _contextAnnotations, _declaredType, _dynamicSerializers, _field, _includeInViews, _internalSettings, _member, _name, _nonTrivialBaseType, _serializer, _suppressableValue, _suppressNulls, _typeSerializer
 
Constructor Summary
UnwrappingBeanPropertyWriter(BeanPropertyWriter base)
           
UnwrappingBeanPropertyWriter(BeanPropertyWriter base, JsonSerializer<Object> ser)
           
 
Method Summary
protected  JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map, Class<?> type, SerializerProvider provider)
           
 void serializeAsField(Object bean, JsonGenerator jgen, SerializerProvider prov)
          Method called to access property that this bean stands for, from within given bean, and to serialize it as a JSON Object field using appropriate serializer.
 BeanPropertyWriter withSerializer(JsonSerializer<Object> ser)
          Method that will construct and return a new writer that has same properties as this writer, but uses specified serializer instead of currently configured one (if any).
 
Methods inherited from class org.codehaus.jackson.map.ser.BeanPropertyWriter
_reportSelfReference, get, getAnnotation, getContextAnnotation, getGenericPropertyType, getInternalSetting, getMember, getName, getPropertyType, getRawSerializationType, getSerializationType, getSerializedName, getSerializer, getType, getViews, hasSerializer, removeInternalSetting, setInternalSetting, setNonTrivialBaseType, setViews, toString, unwrappingWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnwrappingBeanPropertyWriter

public UnwrappingBeanPropertyWriter(BeanPropertyWriter base)

UnwrappingBeanPropertyWriter

public UnwrappingBeanPropertyWriter(BeanPropertyWriter base,
                                    JsonSerializer<Object> ser)
Method Detail

withSerializer

public BeanPropertyWriter withSerializer(JsonSerializer<Object> ser)
Description copied from class: BeanPropertyWriter
Method that will construct and return a new writer that has same properties as this writer, but uses specified serializer instead of currently configured one (if any).

Overrides:
withSerializer in class BeanPropertyWriter

serializeAsField

public void serializeAsField(Object bean,
                             JsonGenerator jgen,
                             SerializerProvider prov)
                      throws Exception
Description copied from class: BeanPropertyWriter
Method called to access property that this bean stands for, from within given bean, and to serialize it as a JSON Object field using appropriate serializer.

Overrides:
serializeAsField in class BeanPropertyWriter
Throws:
Exception

_findAndAddDynamic

protected JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map,
                                                    Class<?> type,
                                                    SerializerProvider provider)
                                             throws JsonMappingException
Overrides:
_findAndAddDynamic in class BeanPropertyWriter
Throws:
JsonMappingException