Package org.codehaus.jackson.map.ser
Class PropertyBuilder
- java.lang.Object
-
- org.codehaus.jackson.map.ser.PropertyBuilder
-
public class PropertyBuilder extends java.lang.ObjectHelper class forBeanSerializerFactorythat is used to constructBeanPropertyWriterinstances. Can be sub-classed to change behavior.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPropertyBuilder.EmptyArrayCheckerHelper object used to check if given array object is null or emptystatic classPropertyBuilder.EmptyCollectionCheckerHelper object used to check if given Collection object is null or emptystatic classPropertyBuilder.EmptyMapCheckerHelper object used to check if given Map object is null or emptystatic classPropertyBuilder.EmptyStringCheckerHelper object used to check if given String object is null or empty
-
Field Summary
Fields Modifier and Type Field Description protected AnnotationIntrospector_annotationIntrospectorprotected BasicBeanDescription_beanDescprotected SerializationConfig_configprotected java.lang.Object_defaultBeanIf a property has serialization inclusion value ofJsonSerialize.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 Summary
Constructors Constructor Description PropertyBuilder(SerializationConfig config, BasicBeanDescription beanDesc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object_throwWrapped(java.lang.Exception e, java.lang.String propName, java.lang.Object defaultBean)protected BeanPropertyWriterbuildWriter(java.lang.String name, JavaType declaredType, JsonSerializer<java.lang.Object> 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).AnnotationsgetClassAnnotations()protected java.lang.ObjectgetContainerValueChecker(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.ObjectgetDefaultBean()protected java.lang.ObjectgetDefaultValue(java.lang.String name, java.lang.reflect.Method m, java.lang.reflect.Field f)protected java.lang.ObjectgetEmptyValueChecker(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.
-
-
-
Field Detail
-
_config
protected final SerializationConfig _config
-
_beanDesc
protected final BasicBeanDescription _beanDesc
-
_outputProps
protected final JsonSerialize.Inclusion _outputProps
-
_annotationIntrospector
protected final AnnotationIntrospector _annotationIntrospector
-
_defaultBean
protected java.lang.Object _defaultBean
If a property has serialization inclusion value ofJsonSerialize.Inclusion.ALWAYS, we need to know the default value of the bean, to know if property value equals default one.
-
-
Constructor Detail
-
PropertyBuilder
public PropertyBuilder(SerializationConfig config, BasicBeanDescription beanDesc)
-
-
Method Detail
-
getClassAnnotations
public Annotations getClassAnnotations()
-
buildWriter
protected BeanPropertyWriter buildWriter(java.lang.String name, JavaType declaredType, JsonSerializer<java.lang.Object> 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)
-
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
protected java.lang.Object getDefaultBean()
-
getDefaultValue
protected java.lang.Object getDefaultValue(java.lang.String name, java.lang.reflect.Method m, java.lang.reflect.Field f)
-
getContainerValueChecker
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. This is usually- Parameters:
propertyName- Name of property to handlepropertyType- Declared type of values of the property to handle- Returns:
- Object whose
equals()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) - Since:
- 1.9
-
getEmptyValueChecker
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. If type has such concept, will build a comparator; otherwise return null, and in latter case, only null values are considered 'empty'.- Parameters:
propertyName- Name of property to handlepropertyType- Declared type of values of the property to handle- Returns:
- Object whose
equals()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) - Since:
- 1.9
-
_throwWrapped
protected java.lang.Object _throwWrapped(java.lang.Exception e, java.lang.String propName, java.lang.Object defaultBean)
-
-