public class PropertyBuilder
extends java.lang.Object
BeanSerializerFactory
that is used to
construct BeanPropertyWriter
instances. Can be sub-classed
to change behavior.Modifier and Type | Class and Description |
---|---|
static class |
PropertyBuilder.EmptyArrayChecker
Helper object used to check if given array object is null or empty
|
static class |
PropertyBuilder.EmptyCollectionChecker
Helper object used to check if given Collection object is null or empty
|
static class |
PropertyBuilder.EmptyMapChecker
Helper object used to check if given Map object is null or empty
|
static class |
PropertyBuilder.EmptyStringChecker
Helper object used to check if given String object is null or empty
|
Modifier and Type | Field and Description |
---|---|
protected AnnotationIntrospector |
_annotationIntrospector |
protected BasicBeanDescription |
_beanDesc |
protected SerializationConfig |
_config |
protected java.lang.Object |
_defaultBean
If a property has serialization inclusion value of
JsonSerialize.Inclusion.ALWAYS , we need to know the default
value of the bean, to know if property value equals default
one. |
protected JsonSerialize.Inclusion |
_outputProps |
Constructor and Description |
---|
PropertyBuilder(SerializationConfig config,
BasicBeanDescription beanDesc) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
_throwWrapped(java.lang.Exception e,
java.lang.String propName,
java.lang.Object defaultBean) |
protected BeanPropertyWriter |
buildWriter(java.lang.String name,
JavaType declaredType,
JsonSerializer<java.lang.Object> ser,
TypeSerializer typeSer,
TypeSerializer contentTypeSer,
AnnotatedMember am,
boolean defaultUseStaticTyping) |
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).
|
Annotations |
getClassAnnotations() |
protected java.lang.Object |
getContainerValueChecker(java.lang.String propertyName,
JavaType propertyType)
Helper method called to see if we need a comparator Object to check if values
of a container (Collection, array) property should be suppressed.
|
protected java.lang.Object |
getDefaultBean() |
protected java.lang.Object |
getDefaultValue(java.lang.String name,
java.lang.reflect.Method m,
java.lang.reflect.Field f) |
protected java.lang.Object |
getEmptyValueChecker(java.lang.String propertyName,
JavaType propertyType)
Helper method called to see if we need a comparator Object to check if values
of specified type are consider empty.
|
protected final SerializationConfig _config
protected final BasicBeanDescription _beanDesc
protected final JsonSerialize.Inclusion _outputProps
protected final AnnotationIntrospector _annotationIntrospector
protected java.lang.Object _defaultBean
JsonSerialize.Inclusion.ALWAYS
, we need to know the default
value of the bean, to know if property value equals default
one.public PropertyBuilder(SerializationConfig config, BasicBeanDescription beanDesc)
public Annotations getClassAnnotations()
protected BeanPropertyWriter buildWriter(java.lang.String name, JavaType declaredType, JsonSerializer<java.lang.Object> ser, TypeSerializer typeSer, TypeSerializer contentTypeSer, AnnotatedMember am, boolean defaultUseStaticTyping)
contentTypeSer
- Optional explicit type information serializer
to use for contained values (only used for properties that are
of container type)protected JavaType findSerializationType(Annotated a, boolean useStaticTyping, JavaType declaredType)
protected java.lang.Object getDefaultBean()
protected java.lang.Object getDefaultValue(java.lang.String name, java.lang.reflect.Method m, java.lang.reflect.Field f)
protected java.lang.Object getContainerValueChecker(java.lang.String propertyName, JavaType propertyType)
propertyName
- Name of property to handlepropertyType
- Declared type of values of the property to handleequals()
method is called to check if given value
is "empty Collection" value to suppress; or null if no such check should be done
(declared type not Collection or array)protected java.lang.Object getEmptyValueChecker(java.lang.String propertyName, JavaType propertyType)
propertyName
- Name of property to handlepropertyType
- Declared type of values of the property to handleequals()
method is called to check if given value
is "empty Collection" value to suppress; or null if no such check should be done
(declared type not Collection or array)protected java.lang.Object _throwWrapped(java.lang.Exception e, java.lang.String propName, java.lang.Object defaultBean)