|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BeanPropertyFilter
Interface that defines API for filter objects use (as configured
using JsonFilter
)
for filtering bean properties to serialize.
Note that Jackson 2.1 added two new methods -- as a result, it is
strongly recommended that custom implementations extend
SimpleBeanPropertyFilter
,
to avoid backwards compatibility issues in future.
Method Summary | |
---|---|
void |
depositSchemaProperty(BeanPropertyWriter writer,
JsonObjectFormatVisitor objectVisitor,
SerializerProvider provider)
Method called by BeanSerializer to let the filter determine whether, and in what
form the given property exist within the parent, or root, schema. |
void |
depositSchemaProperty(BeanPropertyWriter writer,
ObjectNode propertiesNode,
SerializerProvider provider)
Method called by BeanSerializer to let the filter determine whether, and in what
form the given property exist within the parent, or root, schema. |
void |
serializeAsField(Object bean,
JsonGenerator jgen,
SerializerProvider prov,
BeanPropertyWriter writer)
Method called by BeanSerializer to let filter decide what to do with
given bean property value: the usual choices are to either filter out (i.e. |
Method Detail |
---|
void serializeAsField(Object bean, JsonGenerator jgen, SerializerProvider prov, BeanPropertyWriter writer) throws Exception
BeanSerializer
to let filter decide what to do with
given bean property value: the usual choices are to either filter out (i.e.
do nothing) or write using given BeanPropertyWriter
, although filters
can choose other to do something different altogether.
bean
- Bean of which property value to serializejgen
- Generator use for serializing valueprov
- Provider that can be used for accessing dynamic aspects of serialization
processingwriter
- Default bean property serializer to use
Exception
void depositSchemaProperty(BeanPropertyWriter writer, ObjectNode propertiesNode, SerializerProvider provider) throws JsonMappingException
BeanSerializer
to let the filter determine whether, and in what
form the given property exist within the parent, or root, schema. Filters can omit
adding the property to the node, or choose the form of the schema value for the property.
Typical implementation is something like:
if (include(writer)) { writer.depositSchemaProperty(propertiesNode, provider); }
writer
- Bean property serializer to use to create schema valuepropertiesNode
- Node which the given property would exist withinprovider
- Provider that can be used for accessing dynamic aspects of serialization
processing
JsonMappingException
void depositSchemaProperty(BeanPropertyWriter writer, JsonObjectFormatVisitor objectVisitor, SerializerProvider provider) throws JsonMappingException
BeanSerializer
to let the filter determine whether, and in what
form the given property exist within the parent, or root, schema. Filters can omit
adding the property to the node, or choose the form of the schema value for the property
Typical implementation is something like:
if (include(writer)) { writer.depositSchemaProperty(objectVisitor, provider); }
writer
- Bean property serializer to use to create schema valueobjectVisitor
- JsonObjectFormatVisitor which should be aware of
the property's existenceprovider
- Provider that can be used for accessing dynamic aspects of serialization
processing
JsonMappingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |