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, Serializable
VirtualBeanPropertyWriter implementation used for
JsonAppend,
to serialize properties backed-by dynamically assignable attribute
values.- Since:
- 2.5
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface BeanProperty
BeanProperty.Bogus, BeanProperty.Std -
Field Summary
FieldsFields inherited from class BeanPropertyWriter
_accessorMethod, _cfgSerializationType, _contextAnnotations, _declaredType, _dynamicSerializers, _field, _includeInViews, _internalSettings, _member, _name, _nonTrivialBaseType, _nullSerializer, _serializer, _suppressableValue, _suppressNulls, _typeSerializer, _wrapperName, MARKER_FOR_EMPTYFields inherited from class ConcreteBeanPropertyBase
_aliases, _metadataFields inherited from interface BeanProperty
EMPTY_FORMAT, EMPTY_INCLUDE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAttributePropertyWriter(String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType) protectedAttributePropertyWriter(String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType, com.fasterxml.jackson.annotation.JsonInclude.Value inclusion) -
Method Summary
Modifier and TypeMethodDescriptionstatic AttributePropertyWriterconstruct(String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType) protected Objectvalue(Object bean, com.fasterxml.jackson.core.JsonGenerator jgen, SerializerProvider prov) Method called to figure out the value to serialize.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 anIllegalStateException.Methods inherited from class VirtualBeanPropertyWriter
_suppressableValue, _suppressNulls, isVirtual, serializeAsElement, serializeAsFieldMethods inherited from class 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, wouldConflictWithNameMethods inherited from class PropertyWriter
findAnnotationMethods inherited from class ConcreteBeanPropertyBase
findAliases, findFormatOverrides, findPropertyFormat, findPropertyInclusion, getMetadata, isRequired
-
Field Details
-
_attrName
-
-
Constructor Details
-
AttributePropertyWriter
protected AttributePropertyWriter(String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType) -
AttributePropertyWriter
protected AttributePropertyWriter(String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType, com.fasterxml.jackson.annotation.JsonInclude.Value inclusion) -
AttributePropertyWriter
-
-
Method Details
-
construct
public static AttributePropertyWriter construct(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 anIllegalStateException.- Specified by:
withConfigin classVirtualBeanPropertyWriter- Parameters:
config- Currenct configuration; guaranteed to beSerializationConfig(just not typed since caller does not have dependency to serialization-specific types)declaringClass- Class that contains this property writerpropDef- Nominal property definition to usetype- Declared type for the property
-
value
protected Object value(Object bean, com.fasterxml.jackson.core.JsonGenerator jgen, SerializerProvider prov) throws Exception Description copied from class:VirtualBeanPropertyWriterMethod called to figure out the value to serialize. For simple sub-types (such asAttributePropertyWriter) this may be one of few methods to define, although more advanced implementations may choose to not even use this method (by overridingVirtualBeanPropertyWriter.serializeAsField(Object, JsonGenerator, SerializerProvider)) and define a bogus implementation.- Specified by:
valuein classVirtualBeanPropertyWriter- Throws:
Exception
-