AttributePropertyWriter
Date: 2016-12-04

com.fasterxml.jackson.databind.ser.impl

## Class AttributePropertyWriter

- 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.VirtualBeanPropertyWriter
        - - com.fasterxml.jackson.databind.ser.impl.AttributePropertyWriter

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

      public class AttributePropertyWriter
      extends VirtualBeanPropertyWriter

  `VirtualBeanPropertyWriter` implementation used for `JsonAppend`, to serialize properties backed-by dynamically assignable attribute values.
  Since:
    2.5
  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 java.lang.String` | `_attrName`

    - ### 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
    --- | ---
    `protected` | `AttributePropertyWriter(AttributePropertyWriter base)`
    `protected` | `AttributePropertyWriter(java.lang.String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType)`
    `protected` | `AttributePropertyWriter(java.lang.String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType, com.fasterxml.jackson.annotation.JsonInclude.Value inclusion)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static AttributePropertyWriter` | `construct(java.lang.String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType)`
    `protected java.lang.Object` | `value(java.lang.Object bean, com.fasterxml.jackson.core.JsonGenerator jgen, SerializerProvider prov)` Method called to figure out the value to serialize.
    `VirtualBeanPropertyWriter` | `withConfig(MapperConfig<?> config, AnnotatedClass declaringClass, BeanPropertyDefinition propDef, JavaType type)` Since this method should typically not be called on this sub-type, default implementation simply throws an `IllegalStateException`.

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

      `_suppressableValue, _suppressNulls, isVirtual, serializeAsElement, serializeAsField`

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

      `_depositSchemaProperty, _findAndAddDynamic, _handleSelfReference, _new, assignNullSerializer, assignSerializer, assignTypeSerializer, depositSchemaProperty, depositSchemaProperty, fixAccess, get, getAnnotation, getContextAnnotation, getFullName, getGenericPropertyType, getInternalSetting, getMember, getName, getPropertyType, getRawSerializationType, getSerializationType, getSerializedName, getSerializer, getType, getTypeSerializer, getViews, getWrapperName, hasNullSerializer, hasSerializer, isUnwrapping, removeInternalSetting, rename, 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`

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

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

- - ### Field Detail

    - #### _attrName

          protected final java.lang.String _attrName

  - ### Constructor Detail

    - #### AttributePropertyWriter

          protected AttributePropertyWriter(java.lang.String attrName,
                                 BeanPropertyDefinition propDef,
                                 Annotations contextAnnotations,
                                 JavaType declaredType)

    - #### AttributePropertyWriter

          protected AttributePropertyWriter(java.lang.String attrName,
                                 BeanPropertyDefinition propDef,
                                 Annotations contextAnnotations,
                                 JavaType declaredType,
                                 com.fasterxml.jackson.annotation.JsonInclude.Value inclusion)

    - #### AttributePropertyWriter

          protected AttributePropertyWriter(AttributePropertyWriter base)

  - ### Method Detail

    - #### construct

          public static AttributePropertyWriter construct(java.lang.String attrName,
                                          BeanPropertyDefinition propDef,
                                          Annotations contextAnnotations,
                                          JavaType declaredType)

    - #### withConfig

          public VirtualBeanPropertyWriter withConfig(MapperConfig<?> config,
                                             AnnotatedClass declaringClass,
                                             BeanPropertyDefinition propDef,
                                             JavaType type)

      Since this method should typically not be called on this sub-type, default implementation simply throws an `IllegalStateException`.
      Specified by:
        `withConfig` in class `VirtualBeanPropertyWriter`
      Parameters:
        `config` - Currenct configuration; guaranteed to be `SerializationConfig` (just not typed since caller does not have dependency to serialization-specific types)
        `declaringClass` - Class that contains this property writer
        `propDef` - Nominal property definition to use
        `type` - Declared type for the property

    - #### value

          protected java.lang.Object value(java.lang.Object bean,
                               com.fasterxml.jackson.core.JsonGenerator jgen,
                               SerializerProvider prov)
                                    throws java.lang.Exception

      Description copied from class: `VirtualBeanPropertyWriter`
      Method called to figure out the value to serialize. For simple sub-types (such as `AttributePropertyWriter`) this may be one of few methods to define, although more advanced implementations may choose to not even use this method (by overriding `VirtualBeanPropertyWriter.serializeAsField(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)`) and define a bogus implementation.
      Specified by:
        `value` in class `VirtualBeanPropertyWriter`
      Throws:
        `java.lang.Exception`