Package org.codehaus.jackson.map.ser
Class BeanSerializerBuilder
- java.lang.Object
-
- org.codehaus.jackson.map.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.- Since:
- 1.7
-
-
Field Summary
Fields Modifier and Type Field Description protected AnyGetterWriter
_anyGetter
Writer used for "any getter" properties, if any.protected BasicBeanDescription
_beanDesc
protected BeanPropertyWriter[]
_filteredProperties
Optional array of filtered property writers; if null, no view-based filtering is performed.protected java.lang.Object
_filterId
Id of the property filter to use for POJO, if any.protected java.util.List<BeanPropertyWriter>
_properties
Bean properties, in order of serialization
-
Constructor Summary
Constructors Modifier Constructor Description BeanSerializerBuilder(BasicBeanDescription beanDesc)
protected
BeanSerializerBuilder(BeanSerializerBuilder src)
Copy-constructor that may be used for sub-classing
-
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)BasicBeanDescription
getBeanDescription()
BeanPropertyWriter[]
getFilteredProperties()
java.util.List<BeanPropertyWriter>
getProperties()
boolean
hasProperties()
void
setAnyGetter(AnyGetterWriter anyGetter)
void
setFilteredProperties(BeanPropertyWriter[] properties)
void
setFilterId(java.lang.Object filterId)
void
setProperties(java.util.List<BeanPropertyWriter> properties)
-
-
-
Field Detail
-
_beanDesc
protected final BasicBeanDescription _beanDesc
-
_properties
protected java.util.List<BeanPropertyWriter> _properties
Bean properties, in order of serialization
-
_filteredProperties
protected BeanPropertyWriter[] _filteredProperties
Optional array of filtered property writers; if null, no view-based filtering is performed.
-
_anyGetter
protected AnyGetterWriter _anyGetter
Writer used for "any getter" properties, if any.
-
_filterId
protected java.lang.Object _filterId
Id of the property filter to use for POJO, if any.
-
-
Constructor Detail
-
BeanSerializerBuilder
public BeanSerializerBuilder(BasicBeanDescription beanDesc)
-
BeanSerializerBuilder
protected BeanSerializerBuilder(BeanSerializerBuilder src)
Copy-constructor that may be used for sub-classing
-
-
Method Detail
-
getBeanDescription
public BasicBeanDescription getBeanDescription()
-
getProperties
public java.util.List<BeanPropertyWriter> getProperties()
-
getFilteredProperties
public BeanPropertyWriter[] getFilteredProperties()
-
hasProperties
public boolean hasProperties()
- Since:
- 1.9
-
setProperties
public void setProperties(java.util.List<BeanPropertyWriter> properties)
-
setFilteredProperties
public void setFilteredProperties(BeanPropertyWriter[] properties)
-
setAnyGetter
public void setAnyGetter(AnyGetterWriter anyGetter)
-
setFilterId
public void setFilterId(java.lang.Object filterId)
-
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)
-
-