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

public Class AttributePropertyWriter

extends VirtualBeanPropertyWriter
Class Inheritance
Imports
com.fasterxml.jackson.annotation.JsonInclude, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.cfg.MapperConfig, com.fasterxml.jackson.databind.introspect.AnnotatedClass, .BeanPropertyDefinition, com.fasterxml.jackson.databind.ser.VirtualBeanPropertyWriter, com.fasterxml.jackson.databind.util.Annotations

VirtualBeanPropertyWriter implementation used for com.fasterxml.jackson.databind.annotation.JsonAppend, to serialize properties backed-by dynamically assignable attribute values.
Since
2.5

Field Summary

Modifier and TypeField and Description
protected final String
private static final long

Constructor Summary

AccessConstructor and Description
protected
AttributePropertyWriter(String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType)

protected
AttributePropertyWriter(String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType, JsonInclude.Value inclusion)

protected

Method Summary

Modifier and TypeMethod and Description
public static AttributePropertyWriter
construct(String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType)

protected Object
value(Object bean, JsonGenerator jgen, SerializerProvider prov)

Implements abstract com.fasterxml.jackson.databind.ser.VirtualBeanPropertyWriter.value.

Method called to figure out the value to serialize.
public VirtualBeanPropertyWriter
withConfig(MapperConfig<?>
Currenct configuration; guaranteed to be SerializationConfig (just not typed since caller does not have dependency to serialization-specific types)
config
,
AnnotatedClass
Class that contains this property writer
declaringClass
,
BeanPropertyDefinition
Nominal property definition to use
propDef
,
JavaType
Declared type for the property
type
)

Implements abstract com.fasterxml.jackson.databind.ser.VirtualBeanPropertyWriter.withConfig.

Since this method should typically not be called on this sub-type, default implementation simply throws an IllegalStateException.
Inherited from com.fasterxml.jackson.databind.ser.VirtualBeanPropertyWriter:
_suppressableValue_suppressNullsisVirtualserializeAsElementserializeAsField

Field Detail

_attrNameback to summary
protected final String _attrName
serialVersionUIDback to summary
private static final long serialVersionUID

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

Constructor Detail

AttributePropertyWriterback to summary
protected AttributePropertyWriter(String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType)
AttributePropertyWriterback to summary
protected AttributePropertyWriter(String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType, JsonInclude.Value inclusion)
AttributePropertyWriterback to summary
protected AttributePropertyWriter(AttributePropertyWriter base)

Method Detail

constructback to summary
public static AttributePropertyWriter construct(String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType)
valueback to summary
protected Object value(Object bean, JsonGenerator jgen, SerializerProvider prov) throws Exception

Implements abstract com.fasterxml.jackson.databind.ser.VirtualBeanPropertyWriter.value.

Doc from com.fasterxml.jackson.databind.ser.VirtualBeanPropertyWriter.value.

Method called to figure out the value to serialize. For simple sub-types (such as com.fasterxml.jackson.databind.ser.impl.AttributePropertyWriter) this may be one of few methods to define, although more advanced implementations may choose to not even use this method (by overriding serializeAsField) and define a bogus implementation.

Annotations
@Override
withConfigback to summary
public VirtualBeanPropertyWriter withConfig(MapperConfig<?> config, AnnotatedClass declaringClass, BeanPropertyDefinition propDef, JavaType type)

Implements abstract com.fasterxml.jackson.databind.ser.VirtualBeanPropertyWriter.withConfig.

Since this method should typically not be called on this sub-type, default implementation simply throws an IllegalStateException.

Parameters
config:MapperConfig<?>

Doc from com.fasterxml.jackson.databind.ser.VirtualBeanPropertyWriter.withConfig.

Currenct configuration; guaranteed to be SerializationConfig (just not typed since caller does not have dependency to serialization-specific types)

declaringClass:AnnotatedClass

Doc from com.fasterxml.jackson.databind.ser.VirtualBeanPropertyWriter.withConfig.

Class that contains this property writer

propDef:BeanPropertyDefinition

Doc from com.fasterxml.jackson.databind.ser.VirtualBeanPropertyWriter.withConfig.

Nominal property definition to use

type:JavaType

Doc from com.fasterxml.jackson.databind.ser.VirtualBeanPropertyWriter.withConfig.

Declared type for the property

Annotations
@Override