java.lang.Object
tools.jackson.databind.ser.BeanSerializerBuilder
Builder class used for aggregating deserialization information about
a POJO, in order to build a
ValueSerializer for serializing
instances.
Main reason for using separate builder class is that this makes it easier
to make actual serializer class fully immutable.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AnyGetterWriterWriter used for "any getter" properties, if any.protected final BeanDescription.Supplierprotected final SerializationConfigprotected BeanPropertyWriter[]Optional array of filtered property writers; if null, no view-based filtering is performed.protected ObjectId of the property filter to use for POJO, if any.protected ObjectIdWriterObject responsible for serializing Object Ids for the handled type, if any.protected List<BeanPropertyWriter>Bean properties, in order of serializationprotected AnnotatedMemberProperty that is used for type id (and not serialized as regular property) -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCopy-constructor that may be used for sub-classingBeanSerializerBuilder(SerializationConfig config, BeanDescription.Supplier beanDescRef) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Method called to createBeanSerializerinstance with all accumulated information.Factory method for constructing an "empty" serializer; one that outputs no properties (but handles JSON objects properly, including type information)booleanvoidsetAnyGetter(AnyGetterWriter anyGetter) voidsetFilteredProperties(BeanPropertyWriter[] properties) voidsetFilterId(Object filterId) voidvoidsetProperties(List<BeanPropertyWriter> properties) voidsetTypeId(AnnotatedMember idProp)
-
Field Details
-
_beanDescRef
-
_config
-
_properties
Bean properties, in order of serialization -
_filteredProperties
Optional array of filtered property writers; if null, no view-based filtering is performed. -
_anyGetter
Writer used for "any getter" properties, if any. -
_filterId
Id of the property filter to use for POJO, if any. -
_typeId
Property that is used for type id (and not serialized as regular property) -
_objectIdWriter
Object responsible for serializing Object Ids for the handled type, if any.
-
-
Constructor Details
-
BeanSerializerBuilder
-
BeanSerializerBuilder
Copy-constructor that may be used for sub-classing
-
-
Method Details
-
setProperties
-
setFilteredProperties
- Parameters:
properties- Number and order of properties here MUST match that of "regular" properties set earlier usingsetProperties(List); if not, anIllegalArgumentExceptionwill be thrown
-
setAnyGetter
-
setFilterId
-
setTypeId
-
setObjectIdWriter
-
getClassInfo
-
getBeanDescriptionRef
-
getProperties
-
hasProperties
public boolean hasProperties() -
getFilteredProperties
-
getAnyGetter
-
getFilterId
-
getTypeId
-
getObjectIdWriter
-
build
Method called to createBeanSerializerinstance with all accumulated information. Will construct a serializer if we have enough information, or return null if not. -
createDummy
Factory method for constructing an "empty" serializer; one that outputs no properties (but handles JSON objects properly, including type information)
-