BeanSerializerBuilder (Jackson JSON Processor)
Date: 2013-07-14

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 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.
  Since:
    1.7

- - ### Field Summary

    Fields
    Modifier and Type | Field and 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 Object` | `_filterId` Id of the property filter to use for POJO, if any.
    `protected List<BeanPropertyWriter>` | `_properties` Bean properties, in order of serialization

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `BeanSerializerBuilder(BasicBeanDescription beanDesc)`
    `protected` | `BeanSerializerBuilder(BeanSerializerBuilder src)` Copy-constructor that may be used for sub-classing

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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)
    `BasicBeanDescription` | `getBeanDescription()`
    `BeanPropertyWriter[]` | `getFilteredProperties()`
    `List<BeanPropertyWriter>` | `getProperties()`
    `boolean` | `hasProperties()`
    `void` | `setAnyGetter(AnyGetterWriter anyGetter)`
    `void` | `setFilteredProperties(BeanPropertyWriter[] properties)`
    `void` | `setFilterId(Object filterId)`
    `void` | `setProperties(List<BeanPropertyWriter> properties)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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 create `BeanSerializer` 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)