public class BeanSerializerBuilder extends Object
JsonSerializer
for serializing
intances.
Main reason for using separate builder class is that this makes it easier
to make actual serializer class fully immutable.限定符和类型 | 字段和说明 |
---|---|
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
|
限定符 | 构造器和说明 |
---|---|
|
BeanSerializerBuilder(BasicBeanDescription beanDesc) |
protected |
BeanSerializerBuilder(BeanSerializerBuilder src)
Copy-constructor that may be used for sub-classing
|
限定符和类型 | 方法和说明 |
---|---|
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) |
protected final BasicBeanDescription _beanDesc
protected List<BeanPropertyWriter> _properties
protected BeanPropertyWriter[] _filteredProperties
protected AnyGetterWriter _anyGetter
protected Object _filterId
public BeanSerializerBuilder(BasicBeanDescription beanDesc)
protected BeanSerializerBuilder(BeanSerializerBuilder src)
public BasicBeanDescription getBeanDescription()
public List<BeanPropertyWriter> getProperties()
public BeanPropertyWriter[] getFilteredProperties()
public boolean hasProperties()
public void setProperties(List<BeanPropertyWriter> properties)
public void setFilteredProperties(BeanPropertyWriter[] properties)
public void setAnyGetter(AnyGetterWriter anyGetter)
public void setFilterId(Object filterId)
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()