Class BeanSerializerBuilder
- java.lang.Object
-
- com.fasterxml.jackson.databind.ser.BeanSerializerBuilder
-
public class BeanSerializerBuilder extends java.lang.Object
Builder class used for aggregating deserialization information about a POJO, in order to build aJsonSerializer
for serializing intances. Main reason for using separate builder class is that this makes it easier to make actual serializer class fully immutable.
-
-
Constructor Summary
Constructors Constructor Description BeanSerializerBuilder(BeanDescription beanDesc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonSerializer<?>
build()
Method called to createBeanSerializer
instance with all accumulated information.BeanSerializer
createDummy()
Factory method for constructing an "empty" serializer; one that outputs no properties (but handles JSON objects properly, including type information)AnyGetterWriter
getAnyGetter()
BeanDescription
getBeanDescription()
AnnotatedClass
getClassInfo()
BeanPropertyWriter[]
getFilteredProperties()
java.lang.Object
getFilterId()
ObjectIdWriter
getObjectIdWriter()
java.util.List<BeanPropertyWriter>
getProperties()
AnnotatedMember
getTypeId()
boolean
hasProperties()
void
setAnyGetter(AnyGetterWriter anyGetter)
void
setFilteredProperties(BeanPropertyWriter[] properties)
void
setFilterId(java.lang.Object filterId)
void
setObjectIdWriter(ObjectIdWriter w)
void
setProperties(java.util.List<BeanPropertyWriter> properties)
void
setTypeId(AnnotatedMember idProp)
-
-
-
Constructor Detail
-
BeanSerializerBuilder
public BeanSerializerBuilder(BeanDescription beanDesc)
-
-
Method Detail
-
setProperties
public void setProperties(java.util.List<BeanPropertyWriter> properties)
-
setFilteredProperties
public void setFilteredProperties(BeanPropertyWriter[] properties)
- 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
public void setAnyGetter(AnyGetterWriter anyGetter)
-
setFilterId
public void setFilterId(java.lang.Object filterId)
-
setTypeId
public void setTypeId(AnnotatedMember idProp)
-
setObjectIdWriter
public void setObjectIdWriter(ObjectIdWriter w)
-
getClassInfo
public AnnotatedClass getClassInfo()
-
getBeanDescription
public BeanDescription getBeanDescription()
-
getProperties
public java.util.List<BeanPropertyWriter> getProperties()
-
hasProperties
public boolean hasProperties()
-
getFilteredProperties
public BeanPropertyWriter[] getFilteredProperties()
-
getAnyGetter
public AnyGetterWriter getAnyGetter()
-
getFilterId
public java.lang.Object getFilterId()
-
getTypeId
public AnnotatedMember getTypeId()
-
getObjectIdWriter
public ObjectIdWriter getObjectIdWriter()
-
build
public JsonSerializer<?> 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
public BeanSerializer createDummy()
Factory method for constructing an "empty" serializer; one that outputs no properties (but handles JSON objects properly, including type information)
-
-