Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.databind.ser;
 
Interface that defines API for filter objects use (as configured using com.fasterxml.jackson.annotation.JsonFilter) for filtering bean properties to serialize.

Starting with version 2.3 this class is deprecated; use PropertyFilter instead.

Deprecated:
Since 2.3: use PropertyFilter instead.
public interface BeanPropertyFilter
{
    
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. do nothing) or write using given BeanPropertyWriter, although filters can choose other to do something different altogether.

Typical implementation is something like:

 if (include(writer)) {
      writer.serializeAsField(pojo, jgen, prov);
 }

Parameters:
pojo Object that contains property value to serialize
jgen Generator use for serializing value
prov Provider that can be used for accessing dynamic aspects of serialization processing
writer Default bean property serializer to use
    public void serializeAsField(Object pojoJsonGenerator jgenSerializerProvider prov,
            BeanPropertyWriter writer)
        throws Exception;
    
    
Method called by 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);
 }

Deprecated:
Since 2.3: new code should use the alternative depositSchemaProperty method
Parameters:
writer Bean property writer to use to create schema value
propertiesNode Node which the given property would exist within
provider Provider that can be used for accessing dynamic aspects of serialization processing
Since:
2.1
    @Deprecated
    public void depositSchemaProperty(BeanPropertyWriter writerObjectNode propertiesNode,
            SerializerProvider provider)
        throws JsonMappingException;
    
    
Method called by 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);
 }

Parameters:
writer Bean property serializer to use to create schema value
objectVisitor JsonObjectFormatVisitor which should be aware of the property's existence
provider Provider that can be used for accessing dynamic aspects of serialization processing
Since:
2.1
    public void depositSchemaProperty(BeanPropertyWriter writerJsonObjectFormatVisitor objectVisitor,
            SerializerProvider provider)
        throws JsonMappingException;
New to GrepCode? Check out our FAQ X