Class BeanSerializerBuilder
java.lang.Object
edu.internet2.middleware.grouperClientExt.com.fasterxml.jackson.databind.ser.BeanSerializerBuilder
Builder class used for aggregating deserialization information about
a POJO, in order to build a
JsonSerializer
for serializing
intances.
Main reason for using separate builder class is that this makes it easier
to make actual serializer class fully immutable.-
Field Summary
Modifier and TypeFieldDescriptionprotected AnyGetterWriter
Writer used for "any getter" properties, if any.protected final BeanDescription
protected SerializationConfig
protected BeanPropertyWriter[]
Optional array of filtered property writers; if null, no view-based filtering is performed.protected Object
Id of the property filter to use for POJO, if any.protected ObjectIdWriter
Object responsible for serializing Object Ids for the handled type, if any.protected List<BeanPropertyWriter>
Bean properties, in order of serializationprotected AnnotatedMember
Property that is used for type id (and not serialized as regular property) -
Constructor Summary
ModifierConstructorDescriptionBeanSerializerBuilder
(BeanDescription beanDesc) protected
Copy-constructor that may be used for sub-classing -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Method called to createBeanSerializer
instance with all accumulated information.Factory method for constructing an "empty" serializer; one that outputs no properties (but handles JSON objects properly, including type information)boolean
void
setAnyGetter
(AnyGetterWriter anyGetter) protected void
setConfig
(SerializationConfig config) Initialization method called right after construction, to specify configuration to use.void
setFilteredProperties
(BeanPropertyWriter[] properties) void
setFilterId
(Object filterId) void
void
setProperties
(List<BeanPropertyWriter> properties) void
setTypeId
(AnnotatedMember idProp)
-
Field Details
-
_beanDesc
-
_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
-
setConfig
Initialization method called right after construction, to specify configuration to use.Note: ideally should be passed in constructor, but for backwards compatibility, needed to add a setter instead
- Since:
- 2.1
-
setProperties
-
setFilteredProperties
- Parameters:
properties
- Number and order of properties here MUST match that of "regular" properties set earlier usingsetProperties(List)
; if not, anIllegalArgumentException
will be thrown
-
setAnyGetter
-
setFilterId
-
setTypeId
-
setObjectIdWriter
-
getClassInfo
-
getBeanDescription
-
getProperties
-
hasProperties
public boolean hasProperties() -
getFilteredProperties
-
getAnyGetter
-
getFilterId
-
getTypeId
-
getObjectIdWriter
-
build
Method called to createBeanSerializer
instance 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)
-