Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.ser.impl

public Class UnwrappingBeanPropertyWriter

extends BeanPropertyWriter
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.util.Iterator, .Map.Entry, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.io.SerializedString, com.fasterxml.jackson.databind.JavaType, .JsonMappingException, .JsonNode, .JsonSerializer, .SerializerProvider, com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper, .JsonObjectFormatVisitor, com.fasterxml.jackson.databind.node.ObjectNode, com.fasterxml.jackson.databind.ser.BeanPropertyWriter, com.fasterxml.jackson.databind.util.NameTransformer

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

Field Summary

Modifier and TypeField and Description
protected final NameTransformer
_nameTransformer

Transformer used to add prefix and/or suffix for properties of unwrapped POJO.

private static final long
Inherited from com.fasterxml.jackson.databind.ser.BeanPropertyWriter:
_accessorMethod_cfgSerializationType_contextAnnotations_declaredType_dynamicSerializers_field_includeInViews_internalSettings_member_name_nonTrivialBaseType_nullSerializer_serializer_suppressableValue_suppressNulls_typeSerializer_wrapperNameMARKER_FOR_EMPTY

Constructor Summary

AccessConstructor and Description
public
protected

Method Summary

Modifier and TypeMethod and Description
protected void
protected JsonSerializer<Object>
protected UnwrappingBeanPropertyWriter
_new(NameTransformer transformer, SerializedString newName)

Overridable factory method used by sub-classes

public void
assignSerializer(JsonSerializer<Object> ser)

Overrides com.fasterxml.jackson.databind.ser.BeanPropertyWriter.assignSerializer.

Method called to assign value serializer for property
public void
depositSchemaProperty(final JsonObjectFormatVisitor
Visitor to used as the callback handler
visitor
,
SerializerProvider provider)

Overrides com.fasterxml.jackson.databind.ser.BeanPropertyWriter.depositSchemaProperty.

Implements com.fasterxml.jackson.databind.BeanProperty.depositSchemaProperty.

Traversal method used for things like JSON Schema generation, or POJO introspection.
public boolean
isUnwrapping()

Overrides com.fasterxml.jackson.databind.ser.BeanPropertyWriter.isUnwrapping.

Accessor that will return true if this bean property has to support "unwrapping"; ability to replace POJO structural wrapping with optional name prefix and/or suffix (or in some cases, just removal of wrapper name).
public UnwrappingBeanPropertyWriter
public void
serializeAsField(Object bean, JsonGenerator gen, SerializerProvider prov)

Overrides com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField.

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.
Inherited from com.fasterxml.jackson.databind.ser.BeanPropertyWriter:
_handleSelfReference_newassignNullSerializerassignTypeSerializerdepositSchemaPropertyfixAccessgetgetAnnotationgetContextAnnotationgetFullNamegetGenericPropertyTypegetInternalSettinggetMembergetNamegetPropertyTypegetRawSerializationTypegetSerializationTypegetSerializedNamegetSerializergetTypegetTypeSerializergetViewsgetWrapperNamehasNullSerializerhasSerializerremoveInternalSettingserializeAsElementserializeAsOmittedFieldserializeAsPlaceholdersetInternalSettingsetNonTrivialBaseTypetoStringunwrappingWriterwillSuppressNullswouldConflictWithName

Field Detail

_nameTransformerback to summary
protected final NameTransformer _nameTransformer

Transformer used to add prefix and/or suffix for properties of unwrapped POJO.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serialVersionUID.

Constructor Detail

UnwrappingBeanPropertyWriterback to summary
public UnwrappingBeanPropertyWriter(BeanPropertyWriter base, NameTransformer unwrapper)
UnwrappingBeanPropertyWriterback to summary
protected UnwrappingBeanPropertyWriter(UnwrappingBeanPropertyWriter base, NameTransformer transformer, SerializedString name)

Method Detail

_depositSchemaPropertyback to summary
protected void _depositSchemaProperty(ObjectNode propertiesNode, JsonNode schemaNode)

Overrides com.fasterxml.jackson.databind.ser.BeanPropertyWriter._depositSchemaProperty.

Annotations
@Override
_findAndAddDynamicback to summary
protected JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map, Class<?> type, SerializerProvider provider) throws JsonMappingException

Overrides com.fasterxml.jackson.databind.ser.BeanPropertyWriter._findAndAddDynamic.

Annotations
@Override
_newback to summary
protected UnwrappingBeanPropertyWriter _new(NameTransformer transformer, SerializedString newName)

Overridable factory method used by sub-classes

Since
2.6.0
assignSerializerback to summary
public void assignSerializer(JsonSerializer<Object> ser)

Overrides com.fasterxml.jackson.databind.ser.BeanPropertyWriter.assignSerializer.

Doc from com.fasterxml.jackson.databind.ser.BeanPropertyWriter.assignSerializer.

Method called to assign value serializer for property

Annotations
@Override
depositSchemaPropertyback to summary
public void depositSchemaProperty(final JsonObjectFormatVisitor visitor, SerializerProvider provider) throws JsonMappingException

Overrides com.fasterxml.jackson.databind.ser.BeanPropertyWriter.depositSchemaProperty.

Implements com.fasterxml.jackson.databind.BeanProperty.depositSchemaProperty.

Doc from com.fasterxml.jackson.databind.ser.PropertyWriter.depositSchemaProperty.

Traversal method used for things like JSON Schema generation, or POJO introspection.

Parameters
visitor:JsonObjectFormatVisitor

Doc from com.fasterxml.jackson.databind.BeanProperty.depositSchemaProperty.

Visitor to used as the callback handler

Annotations
@Override
isUnwrappingback to summary
public boolean isUnwrapping()

Overrides com.fasterxml.jackson.databind.ser.BeanPropertyWriter.isUnwrapping.

Doc from com.fasterxml.jackson.databind.ser.BeanPropertyWriter.isUnwrapping.

Accessor that will return true if this bean property has to support "unwrapping"; ability to replace POJO structural wrapping with optional name prefix and/or suffix (or in some cases, just removal of wrapper name).

Default implementation simply returns false.

Annotations
@Override
renameback to summary
public UnwrappingBeanPropertyWriter rename(NameTransformer transformer)

Overrides com.fasterxml.jackson.databind.ser.BeanPropertyWriter.rename.

Annotations
@Override
serializeAsFieldback to summary
public void serializeAsField(Object bean, JsonGenerator gen, SerializerProvider prov) throws Exception

Overrides com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField.

Doc from com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField.

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.

Annotations
@Override