java.lang.Object
tools.jackson.databind.ser.PropertyBuilder
Helper class for
BeanSerializerFactory that is used to
construct BeanPropertyWriter instances. Can be sub-classed
to change behavior.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AnnotationIntrospectorprotected final BeanDescriptionprotected final SerializationConfigprotected ObjectIf a property has serialization inclusion value ofJsonInclude.Include.NON_DEFAULT, we may need to know the default value of the bean, to know if property value equals default one.protected final JsonInclude.ValueDefault inclusion mode for properties of the POJO for which properties are collected; possibly overridden on per-property basis.protected final booleanMarker flag used to indicate that "real" default values are to be used for properties, as per per-type value inclusion of typeNON_DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BeanPropertyWriter_constructPropertyWriter(BeanPropertyDefinition propDef, AnnotatedMember member, Annotations contextAnnotations, JavaType declaredType, ValueSerializer<?> ser, TypeSerializer typeSer, JavaType serType, boolean suppressNulls, Object suppressableValue, Class<?>[] includeInViews) Overridable factory method for actual construction ofBeanPropertyWriter; often needed if subclassingbuildWriter(tools.jackson.databind.SerializationContext, tools.jackson.databind.introspect.BeanPropertyDefinition, tools.jackson.databind.JavaType, tools.jackson.databind.ValueSerializer<?>, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.introspect.AnnotatedMember, boolean)method.protected Object_throwWrapped(Exception e, String propName, Object defaultBean) protected BeanPropertyWriterbuildWriter(SerializationContext ctxt, BeanPropertyDefinition propDef, JavaType declaredType, ValueSerializer<?> ser, TypeSerializer typeSer, TypeSerializer contentTypeSer, AnnotatedMember am, boolean defaultUseStaticTyping) protected JavaTypefindSerializationType(Annotated a, boolean useStaticTyping, JavaType declaredType) Method that will try to determine statically defined type of property being serialized, based on annotations (for overrides), and alternatively declared type (if static typing for serialization is enabled).protected Object
-
Field Details
-
_config
-
_beanDesc
-
_annotationIntrospector
-
_defaultBean
If a property has serialization inclusion value ofJsonInclude.Include.NON_DEFAULT, we may need to know the default value of the bean, to know if property value equals default one.NOTE: only used if enclosing class defines NON_DEFAULT, but NOT if it is the global default OR per-property override.
-
_defaultInclusion
Default inclusion mode for properties of the POJO for which properties are collected; possibly overridden on per-property basis. Combines global inclusion defaults and per-type (annotation and type-override) inclusion overrides. -
_useRealPropertyDefaults
protected final boolean _useRealPropertyDefaultsMarker flag used to indicate that "real" default values are to be used for properties, as per per-type value inclusion of typeNON_DEFAULT
-
-
Constructor Details
-
PropertyBuilder
-
-
Method Details
-
getClassAnnotations
-
buildWriter
protected BeanPropertyWriter buildWriter(SerializationContext ctxt, BeanPropertyDefinition propDef, JavaType declaredType, ValueSerializer<?> ser, TypeSerializer typeSer, TypeSerializer contentTypeSer, AnnotatedMember am, boolean defaultUseStaticTyping) - Parameters:
contentTypeSer- Optional explicit type information serializer to use for contained values (only used for properties that are of container type)
-
_constructPropertyWriter
protected BeanPropertyWriter _constructPropertyWriter(BeanPropertyDefinition propDef, AnnotatedMember member, Annotations contextAnnotations, JavaType declaredType, ValueSerializer<?> ser, TypeSerializer typeSer, JavaType serType, boolean suppressNulls, Object suppressableValue, Class<?>[] includeInViews) Overridable factory method for actual construction ofBeanPropertyWriter; often needed if subclassingbuildWriter(tools.jackson.databind.SerializationContext, tools.jackson.databind.introspect.BeanPropertyDefinition, tools.jackson.databind.JavaType, tools.jackson.databind.ValueSerializer<?>, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.introspect.AnnotatedMember, boolean)method. -
findSerializationType
protected JavaType findSerializationType(Annotated a, boolean useStaticTyping, JavaType declaredType) Method that will try to determine statically defined type of property being serialized, based on annotations (for overrides), and alternatively declared type (if static typing for serialization is enabled). If neither can be used (no annotations, dynamic typing), returns null. -
getDefaultBean
-
_throwWrapped
-