|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.fasterxml.jackson.databind.ser.BeanSerializerBuilder
public class 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 | |
---|---|
protected AnyGetterWriter |
_anyGetter
Writer used for "any getter" properties, if any. |
protected BeanDescription |
_beanDesc
|
protected SerializationConfig |
_config
|
protected BeanPropertyWriter[] |
_filteredProperties
Optional array of filtered property writers; if null, no view-based filtering is performed. |
protected Object |
_filterId
Id of the property filter to use for POJO, if any. |
protected ObjectIdWriter |
_objectIdWriter
Object responsible for serializing Object Ids for the handled type, if any. |
protected List<BeanPropertyWriter> |
_properties
Bean properties, in order of serialization |
protected AnnotatedMember |
_typeId
Property that is used for type id (and not serialized as regular property) |
Constructor Summary | |
---|---|
|
BeanSerializerBuilder(BeanDescription beanDesc)
|
protected |
BeanSerializerBuilder(BeanSerializerBuilder src)
Copy-constructor that may be used for sub-classing |
Method Summary | |
---|---|
JsonSerializer<?> |
build()
Method called to create BeanSerializer 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()
|
Object |
getFilterId()
|
ObjectIdWriter |
getObjectIdWriter()
|
List<BeanPropertyWriter> |
getProperties()
|
AnnotatedMember |
getTypeId()
|
boolean |
hasProperties()
|
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 |
setObjectIdWriter(ObjectIdWriter w)
|
void |
setProperties(List<BeanPropertyWriter> properties)
|
void |
setTypeId(AnnotatedMember idProp)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final BeanDescription _beanDesc
protected SerializationConfig _config
protected List<BeanPropertyWriter> _properties
protected BeanPropertyWriter[] _filteredProperties
protected AnyGetterWriter _anyGetter
protected Object _filterId
protected AnnotatedMember _typeId
protected ObjectIdWriter _objectIdWriter
Constructor Detail |
---|
public BeanSerializerBuilder(BeanDescription beanDesc)
protected BeanSerializerBuilder(BeanSerializerBuilder src)
Method Detail |
---|
protected void setConfig(SerializationConfig config)
Note: ideally should be passed in constructor, but for backwards compatibility, needed to add a setter instead
public void setProperties(List<BeanPropertyWriter> properties)
public void setFilteredProperties(BeanPropertyWriter[] properties)
public void setAnyGetter(AnyGetterWriter anyGetter)
public void setFilterId(Object filterId)
public void setTypeId(AnnotatedMember idProp)
public void setObjectIdWriter(ObjectIdWriter w)
public AnnotatedClass getClassInfo()
public BeanDescription getBeanDescription()
public List<BeanPropertyWriter> getProperties()
public boolean hasProperties()
public BeanPropertyWriter[] getFilteredProperties()
public AnyGetterWriter getAnyGetter()
public Object getFilterId()
public AnnotatedMember getTypeId()
public ObjectIdWriter getObjectIdWriter()
public JsonSerializer<?> build()
BeanSerializer
instance with
all accumulated information. Will construct a serializer if we
have enough information, or return null if not.
public BeanSerializer createDummy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |