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

public Class AttributePropertyWriter

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

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

Field Summary

Modifier and TypeField and Description
protected final String

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, SerializationContext prov)

Implements abstract tools.jackson.databind.ser.VirtualBeanPropertyWriter.value.

Method called to figure out the value to serialize.

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

Implements abstract tools.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 tools.jackson.databind.ser.VirtualBeanPropertyWriter:
_suppressableValue_suppressNullsisVirtualserializeAsElementserializeAsProperty

Field Detail

_attrNameback to summary
protected final String _attrName

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, SerializationContext prov) throws Exception

Implements abstract tools.jackson.databind.ser.VirtualBeanPropertyWriter.value.

Doc from tools.jackson.databind.ser.VirtualBeanPropertyWriter.value.

Method called to figure out the value to serialize. For simple sub-types (such as tools.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 serializeAsProperty) and define a bogus implementation.

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

Implements abstract tools.jackson.databind.ser.VirtualBeanPropertyWriter.withConfig.

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

Annotations
@Override