com.fasterxml.jackson.databind.ser.impl

## Class UnwrappingBeanPropertyWriter

- java.lang.Object
- - com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase
  - - com.fasterxml.jackson.databind.ser.PropertyWriter
    - - com.fasterxml.jackson.databind.ser.BeanPropertyWriter
      - - com.fasterxml.jackson.databind.ser.impl.UnwrappingBeanPropertyWriter

- All Implemented Interfaces:
    BeanProperty, Named, java.io.Serializable

      public class UnwrappingBeanPropertyWriter
      extends BeanPropertyWriter
      implements java.io.Serializable

  Variant of `BeanPropertyWriter` which will handle unwrapping of JSON Object (including of properties of Object within surrounding JSON object, and not as sub-object).
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.fasterxml.jackson.databind.BeanProperty

      `BeanProperty.Std`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected NameTransformer` | `_nameTransformer` Transformer used to add prefix and/or suffix for properties of unwrapped POJO.

    - ### Fields inherited from class com.fasterxml.jackson.databind.ser.BeanPropertyWriter

      `_accessorMethod, _cfgSerializationType, _contextAnnotations, _declaredType, _dynamicSerializers, _field, _includeInViews, _internalSettings, _member, _name, _nonTrivialBaseType, _nullSerializer, _serializer, _suppressableValue, _suppressNulls, _typeSerializer, _wrapperName, MARKER_FOR_EMPTY`

    - ### Fields inherited from class com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase

      `_metadata, _propertyFormat`

    - ### Fields inherited from interface com.fasterxml.jackson.databind.BeanProperty

      `EMPTY_FORMAT, EMPTY_INCLUDE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `UnwrappingBeanPropertyWriter(BeanPropertyWriter base, NameTransformer unwrapper)`
    `protected` | `UnwrappingBeanPropertyWriter(UnwrappingBeanPropertyWriter base, NameTransformer transformer, com.fasterxml.jackson.core.io.SerializedString name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `_depositSchemaProperty(ObjectNode propertiesNode, JsonNode schemaNode)`
    `protected JsonSerializer<java.lang.Object>` | `_findAndAddDynamic(PropertySerializerMap map, java.lang.Class<?> type, SerializerProvider provider)`
    `protected UnwrappingBeanPropertyWriter` | `_new(NameTransformer transformer, com.fasterxml.jackson.core.io.SerializedString newName)` Overridable factory method used by sub-classes
    `void` | `assignSerializer(JsonSerializer<java.lang.Object> ser)` Method called to assign value serializer for property
    `void` | `depositSchemaProperty(JsonObjectFormatVisitor visitor, SerializerProvider provider)` Traversal method used for things like JSON Schema generation, or POJO introspection.
    `boolean` | `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).
    `UnwrappingBeanPropertyWriter` | `rename(NameTransformer transformer)`
    `void` | `serializeAsField(java.lang.Object bean, com.fasterxml.jackson.core.JsonGenerator gen, 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.

    - ### Methods inherited from class com.fasterxml.jackson.databind.ser.BeanPropertyWriter

      `_handleSelfReference, _new, assignNullSerializer, assignTypeSerializer, depositSchemaProperty, fixAccess, get, getAnnotation, getContextAnnotation, getFullName, getGenericPropertyType, getInternalSetting, getMember, getName, getPropertyType, getRawSerializationType, getSerializationType, getSerializedName, getSerializer, getType, getTypeSerializer, getViews, getWrapperName, hasNullSerializer, hasSerializer, removeInternalSetting, serializeAsElement, serializeAsOmittedField, serializeAsPlaceholder, setInternalSetting, setNonTrivialBaseType, toString, unwrappingWriter, willSuppressNulls, wouldConflictWithName`

    - ### Methods inherited from class com.fasterxml.jackson.databind.ser.PropertyWriter

      `findAnnotation`

    - ### Methods inherited from class com.fasterxml.jackson.databind.introspect.ConcreteBeanPropertyBase

      `findFormatOverrides, findPropertyFormat, findPropertyInclusion, getMetadata, isRequired, isVirtual`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### _nameTransformer

          protected final NameTransformer _nameTransformer

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

  - ### Constructor Detail

    - #### UnwrappingBeanPropertyWriter

          public UnwrappingBeanPropertyWriter(BeanPropertyWriter base,
                                      NameTransformer unwrapper)

    - #### UnwrappingBeanPropertyWriter

          protected UnwrappingBeanPropertyWriter(UnwrappingBeanPropertyWriter base,
                                      NameTransformer transformer,
                                      com.fasterxml.jackson.core.io.SerializedString name)

  - ### Method Detail

    - #### rename

          public UnwrappingBeanPropertyWriter rename(NameTransformer transformer)

      Overrides:
        `rename` in class `BeanPropertyWriter`

    - #### _new

          protected UnwrappingBeanPropertyWriter _new(NameTransformer transformer,
                                          com.fasterxml.jackson.core.io.SerializedString newName)

      Overridable factory method used by sub-classes
      Since:
        2.6.0

    - #### isUnwrapping

          public boolean isUnwrapping()

      Description copied from class: `BeanPropertyWriter`
      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.

      Overrides:
        `isUnwrapping` in class `BeanPropertyWriter`

    - #### serializeAsField

          public void serializeAsField(java.lang.Object bean,
                              com.fasterxml.jackson.core.JsonGenerator gen,
                              SerializerProvider prov)
                                throws java.lang.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:
        `java.lang.Exception`

    - #### assignSerializer

          public void assignSerializer(JsonSerializer<java.lang.Object> ser)

      Description copied from class: `BeanPropertyWriter`
      Method called to assign value serializer for property
      Overrides:
        `assignSerializer` in class `BeanPropertyWriter`

    - #### depositSchemaProperty

          public void depositSchemaProperty(JsonObjectFormatVisitor visitor,
                                   SerializerProvider provider)
                                     throws JsonMappingException

      Description copied from class: `PropertyWriter`
      Traversal method used for things like JSON Schema generation, or POJO introspection.
      Specified by:
        `depositSchemaProperty` in interface `BeanProperty`
      Overrides:
        `depositSchemaProperty` in class `BeanPropertyWriter`
      Parameters:
        `visitor` - Visitor to used as the callback handler
      Throws:
        `JsonMappingException`

    - #### _depositSchemaProperty

          protected void _depositSchemaProperty(ObjectNode propertiesNode,
                                    JsonNode schemaNode)

      Overrides:
        `_depositSchemaProperty` in class `BeanPropertyWriter`

    - #### _findAndAddDynamic

          protected JsonSerializer<java.lang.Object> _findAndAddDynamic(PropertySerializerMap map,
                                                            java.lang.Class<?> type,
                                                            SerializerProvider provider)
                                                                 throws JsonMappingException

      Overrides:
        `_findAndAddDynamic` in class `BeanPropertyWriter`
      Throws:
        `JsonMappingException`