public class PropertyBuilder extends Object
BeanSerializerFactory
that is used to
construct BeanPropertyWriter
instances. Can be sub-classed
to change behavior.Modifier and Type | Field and Description |
---|---|
protected AnnotationIntrospector |
_annotationIntrospector |
protected BeanDescription |
_beanDesc |
protected SerializationConfig |
_config |
protected Object |
_defaultBean
If a property has serialization inclusion value of
JsonInclude.Include.NON_DEFAULT ,
we may need to know the default value of the bean, to know if property value
equals default one. |
protected com.fasterxml.jackson.annotation.JsonInclude.Value |
_defaultInclusion
Default inclusion mode for properties of the POJO for which
properties are collected; possibly overridden on
per-property basis.
|
protected boolean |
_useRealPropertyDefaults
Marker flag used to indicate that "real" default values are to be used
for properties, as per per-type value inclusion of type
NON_DEFAULT |
Constructor and Description |
---|
PropertyBuilder(SerializationConfig config,
BeanDescription beanDesc) |
protected final SerializationConfig _config
protected final BeanDescription _beanDesc
protected final AnnotationIntrospector _annotationIntrospector
protected Object _defaultBean
JsonInclude.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.
protected final com.fasterxml.jackson.annotation.JsonInclude.Value _defaultInclusion
protected final boolean _useRealPropertyDefaults
NON_DEFAULT
public PropertyBuilder(SerializationConfig config, BeanDescription beanDesc)
public Annotations getClassAnnotations()
protected BeanPropertyWriter buildWriter(SerializerProvider prov, BeanPropertyDefinition propDef, JavaType declaredType, JsonSerializer<?> ser, TypeSerializer typeSer, TypeSerializer contentTypeSer, AnnotatedMember am, boolean defaultUseStaticTyping) throws JsonMappingException
contentTypeSer
- Optional explicit type information serializer
to use for contained values (only used for properties that are
of container type)JsonMappingException
protected BeanPropertyWriter _constructPropertyWriter(BeanPropertyDefinition propDef, AnnotatedMember member, Annotations contextAnnotations, JavaType declaredType, JsonSerializer<?> ser, TypeSerializer typeSer, JavaType serType, boolean suppressNulls, Object suppressableValue, Class<?>[] includeInViews) throws JsonMappingException
BeanPropertyWriter
;
often needed if subclassing buildWriter(com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition, com.fasterxml.jackson.databind.JavaType, com.fasterxml.jackson.databind.JsonSerializer<?>, com.fasterxml.jackson.databind.jsontype.TypeSerializer, com.fasterxml.jackson.databind.jsontype.TypeSerializer, com.fasterxml.jackson.databind.introspect.AnnotatedMember, boolean)
method.JsonMappingException
protected JavaType findSerializationType(Annotated a, boolean useStaticTyping, JavaType declaredType) throws JsonMappingException
JsonMappingException
protected Object getDefaultBean()
@Deprecated protected Object getPropertyDefaultValue(String name, AnnotatedMember member, JavaType type)
JsonInclude.Include.NON_DEFAULT
.
This method is called when we specifically want to know default value within context
of a POJO, when annotation is within containing class, and not for property or
defined as global baseline.
Note that returning of pseudo-type
JsonInclude.Include.NON_EMPTY
requires special handling.
@Deprecated protected Object getDefaultValue(JavaType type)
Copyright © 2008–2023 FasterXML. All rights reserved.