java.lang.Object
tools.jackson.databind.introspect.ConcreteBeanPropertyBase
tools.jackson.databind.ser.PropertyWriter
tools.jackson.databind.ser.BeanPropertyWriter
tools.jackson.databind.ser.VirtualBeanPropertyWriter
tools.jackson.databind.ser.impl.AttributePropertyWriter
- All Implemented Interfaces:
Serializable
,Named
,BeanProperty
,FullyNamed
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 tools.jackson.databind.BeanProperty
BeanProperty.Bogus, BeanProperty.Std
Nested classes/interfaces inherited from interface tools.jackson.core.util.Named
Named.StringAsNamed
-
Field Summary
FieldsFields inherited from class tools.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 tools.jackson.databind.introspect.ConcreteBeanPropertyBase
_aliases, _metadata
Fields inherited from interface tools.jackson.databind.BeanProperty
EMPTY_FORMAT, EMPTY_INCLUDE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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 TypeMethodDescriptionstatic AttributePropertyWriter
construct
(String attrName, BeanPropertyDefinition propDef, Annotations contextAnnotations, JavaType declaredType) protected Object
value
(Object bean, JsonGenerator jgen, SerializationContext 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 tools.jackson.databind.ser.VirtualBeanPropertyWriter
_suppressableValue, _suppressNulls, isVirtual, serializeAsElement, serializeAsProperty
Methods inherited from class tools.jackson.databind.ser.BeanPropertyWriter
_depositSchemaProperty, _findAndAddDynamic, _handleSelfReference, _new, assignNullSerializer, assignSerializer, assignTypeSerializer, depositSchemaProperty, fixAccess, get, getAnnotation, getContextAnnotation, getFullName, getInternalSetting, getMember, getName, getSerializationType, getSerializedName, getSerializer, getType, getTypeSerializer, getViews, getWrapperName, hasNullSerializer, hasSerializer, isUnwrapping, removeInternalSetting, rename, serializeAsOmittedElement, serializeAsOmittedProperty, setInternalSetting, setNonTrivialBaseType, toString, unwrappingWriter, willSuppressNulls, wouldConflictWithName
Methods inherited from class tools.jackson.databind.ser.PropertyWriter
findAnnotation
Methods inherited from class tools.jackson.databind.introspect.ConcreteBeanPropertyBase
findAliases, findFormatOverrides, findPropertyFormat, findPropertyInclusion, getMetadata, isRequired
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface tools.jackson.databind.util.FullyNamed
hasName
-
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, 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:
withConfig
in 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
Description copied from class:VirtualBeanPropertyWriter
Method 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.serializeAsProperty(java.lang.Object, tools.jackson.core.JsonGenerator, tools.jackson.databind.SerializationContext)
) and define a bogus implementation.- Specified by:
value
in classVirtualBeanPropertyWriter
- Throws:
Exception
-