Top Description Fields Constructors Methods
tools.jackson.databind.ser.bean

public Class UnwrappingBeanPropertyWriter

extends BeanPropertyWriter
Class Inheritance
Imports
java.util.Map.Entry, tools.jackson.core.JsonGenerator, tools.jackson.core.io.SerializedString, tools.jackson.databind.JavaType, .JsonNode, .SerializationContext, .ValueSerializer, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper, .JsonObjectFormatVisitor, tools.jackson.databind.node.ObjectNode, tools.jackson.databind.ser.BeanPropertyWriter, tools.jackson.databind.ser.impl.PropertySerializerMap, tools.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.

Inherited from tools.jackson.databind.ser.BeanPropertyWriter:
_accessor_cfgSerializationType_contextAnnotations_declaredType_dynamicSerializers_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 ValueSerializer<Object>
protected UnwrappingBeanPropertyWriter
_new(NameTransformer transformer, SerializedString newName)

Overridable factory method used by sub-classes

public void
assignSerializer(ValueSerializer<Object> ser)

Overrides tools.jackson.databind.ser.BeanPropertyWriter.assignSerializer.

Method called to assign value serializer for property

public void
depositSchemaProperty(final JsonObjectFormatVisitor visitor, SerializationContext provider)

Overrides tools.jackson.databind.ser.BeanPropertyWriter.depositSchemaProperty.

Implements tools.jackson.databind.BeanProperty.depositSchemaProperty.

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

public boolean
isUnwrapping()

Overrides tools.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
serializeAsProperty(Object bean, JsonGenerator gen, SerializationContext prov)

Overrides tools.jackson.databind.ser.BeanPropertyWriter.serializeAsProperty.

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 tools.jackson.databind.ser.BeanPropertyWriter:
_handleSelfReference_newassignNullSerializerassignTypeSerializerfixAccessgetgetAnnotationgetContextAnnotationgetFullNamegetInternalSettinggetMembergetNamegetSerializationTypegetSerializedNamegetSerializergetTypegetTypeSerializergetViewsgetWrapperNamehasNullSerializerhasSerializerremoveInternalSettingserializeAsElementserializeAsOmittedElementserializeAsOmittedPropertysetInternalSettingsetNonTrivialBaseTypetoStringunwrappingWriterwillSuppressNullswouldConflictWithName

Field Detail

_nameTransformerback to summary
protected final NameTransformer _nameTransformer

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

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 tools.jackson.databind.ser.BeanPropertyWriter._depositSchemaProperty.

Annotations
@Override
_findAndAddDynamicback to summary
protected ValueSerializer<Object> _findAndAddDynamic(PropertySerializerMap map, Class<?> type, SerializationContext provider)

Overrides tools.jackson.databind.ser.BeanPropertyWriter._findAndAddDynamic.

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

Overridable factory method used by sub-classes

assignSerializerback to summary
public void assignSerializer(ValueSerializer<Object> ser)

Overrides tools.jackson.databind.ser.BeanPropertyWriter.assignSerializer.

Doc from tools.jackson.databind.ser.BeanPropertyWriter.assignSerializer.

Method called to assign value serializer for property

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

Overrides tools.jackson.databind.ser.BeanPropertyWriter.depositSchemaProperty.

Implements tools.jackson.databind.BeanProperty.depositSchemaProperty.

Doc from tools.jackson.databind.ser.PropertyWriter.depositSchemaProperty.

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

Annotations
@Override
isUnwrappingback to summary
public boolean isUnwrapping()

Overrides tools.jackson.databind.ser.BeanPropertyWriter.isUnwrapping.

Doc from tools.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 tools.jackson.databind.ser.BeanPropertyWriter.rename.

Annotations
@Override
serializeAsPropertyback to summary
public void serializeAsProperty(Object bean, JsonGenerator gen, SerializationContext prov) throws Exception

Overrides tools.jackson.databind.ser.BeanPropertyWriter.serializeAsProperty.

Doc from tools.jackson.databind.ser.BeanPropertyWriter.serializeAsProperty.

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