Package org.codehaus.jackson.map.ser
Class BeanSerializerBuilder
- java.lang.Object
-
- org.codehaus.jackson.map.ser.BeanSerializerBuilder
-
public class BeanSerializerBuilder extends Object
Builder class used for aggregating deserialization information about a POJO, in order to build aJsonSerializerfor 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_anyGetterWriter used for "any getter" properties, if any.protected BasicBeanDescription_beanDescprotected BeanPropertyWriter[]_filteredPropertiesOptional array of filtered property writers; if null, no view-based filtering is performed.protected Object_filterIdId of the property filter to use for POJO, if any.protected List<BeanPropertyWriter>_propertiesBean properties, in order of serialization
-
Constructor Summary
Constructors Modifier Constructor Description BeanSerializerBuilder(BasicBeanDescription beanDesc)protectedBeanSerializerBuilder(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 createBeanSerializerinstance with all accumulated information.BeanSerializercreateDummy()Factory method for constructing an "empty" serializer; one that outputs no properties (but handles JSON objects properly, including type information)BasicBeanDescriptiongetBeanDescription()BeanPropertyWriter[]getFilteredProperties()List<BeanPropertyWriter>getProperties()booleanhasProperties()voidsetAnyGetter(AnyGetterWriter anyGetter)voidsetFilteredProperties(BeanPropertyWriter[] properties)voidsetFilterId(Object filterId)voidsetProperties(List<BeanPropertyWriter> properties)
-
-
-
Field Detail
-
_beanDesc
protected final BasicBeanDescription _beanDesc
-
_properties
protected 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 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 List<BeanPropertyWriter> getProperties()
-
getFilteredProperties
public BeanPropertyWriter[] getFilteredProperties()
-
hasProperties
public boolean hasProperties()
- Since:
- 1.9
-
setProperties
public void setProperties(List<BeanPropertyWriter> properties)
-
setFilteredProperties
public void setFilteredProperties(BeanPropertyWriter[] properties)
-
setAnyGetter
public void setAnyGetter(AnyGetterWriter anyGetter)
-
setFilterId
public void setFilterId(Object filterId)
-
build
public JsonSerializer<?> build()
Method called to createBeanSerializerinstance 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)
-
-