Top Description Inners Constructors Methods
com.fasterxml.jackson.databind.ser.impl

public Class SimpleBeanPropertyFilter

extends Object
implements BeanPropertyFilter, PropertyFilter
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.databind.ser.PropertyFilter, com.fasterxml.jackson.databind.ser.BeanPropertyFilter
Known Direct Subclasses
com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.FilterExceptFilter, com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.SerializeExceptFilter
Annotations
@SuppressWarnings:deprecation
Imports
java.util.*, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.node.ObjectNode, com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor, com.fasterxml.jackson.databind.ser.*

References Deprecated

BeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Simple PropertyFilter implementation that only uses property name to determine whether to serialize property as is, or to filter it out.

Use of this class as the base implementation for any custom PropertyFilter implementations is strongly encouraged, because it can provide default implementation for any methods that may be added in PropertyFilter (as unfortunate as additions may be).

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
SimpleBeanPropertyFilter.FilterExceptFilter

References Deprecated SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.
Filter implementation which defaults to filtering out unknown properties and only serializes ones explicitly listed.
public static class
SimpleBeanPropertyFilter.SerializeExceptFilter

References Deprecated SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.
Filter implementation which defaults to serializing all properties, except for ones explicitly listed to be filtered out.

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
depositSchemaProperty(BeanPropertyWriter
Bean property writer to use to create schema value
writer
,
ObjectNode
Node which the given property would exist within
propertiesNode
,
SerializerProvider
Provider that can be used for accessing dynamic aspects of serialization processing
provider
)

Implements com.fasterxml.jackson.databind.ser.BeanPropertyFilter.depositSchemaProperty.

Deprecated

Method called by BeanSerializer to let the filter determine whether, and in what form the given property exist within the parent, or root, schema.

public void
depositSchemaProperty(BeanPropertyWriter
Bean property serializer to use to create schema value
writer
,
JsonObjectFormatVisitor
JsonObjectFormatVisitor which should be aware of the property's existence
objectVisitor
,
SerializerProvider
Provider that can be used for accessing dynamic aspects of serialization processing
provider
)

Implements com.fasterxml.jackson.databind.ser.BeanPropertyFilter.depositSchemaProperty.

Deprecated

Method called by BeanSerializer to let the filter determine whether, and in what form the given property exist within the parent, or root, schema.

public void
depositSchemaProperty(PropertyWriter
Bean property writer to use to create schema value
writer
,
ObjectNode
Node which the given property would exist within
propertiesNode
,
SerializerProvider
Provider that can be used for accessing dynamic aspects of serialization processing
provider
)

Implements com.fasterxml.jackson.databind.ser.PropertyFilter.depositSchemaProperty.

Deprecated

Method called by BeanSerializer to let the filter determine whether, and in what form the given property exist within the parent, or root, schema.

public void
depositSchemaProperty(PropertyWriter
Bean property serializer to use to create schema value
writer
,
JsonObjectFormatVisitor
JsonObjectFormatVisitor which should be aware of the property's existence
objectVisitor
,
SerializerProvider
Provider that can be used for accessing dynamic aspects of serialization processing
provider
)

Implements com.fasterxml.jackson.databind.ser.PropertyFilter.depositSchemaProperty.

Method called by BeanSerializer to let the filter determine whether, and in what form the given property exist within the parent, or root, schema.

public static SimpleBeanPropertyFilter
filterOutAll()
References Deprecated SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

Convenience factory method that will return a filter that will simply filter out everything.

public static SimpleBeanPropertyFilter
filterOutAllExcept(Set<String> properties)
References Deprecated SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

Factory method to construct filter that filters out all properties except ones includes in set

public static SimpleBeanPropertyFilter
filterOutAllExcept(String... propertyArray)
References Deprecated SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

public static PropertyFilter
from(final BeanPropertyFilter src)
References Deprecated BeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

Helper method to ease transition from BeanPropertyWriter into PropertyWriter

protected boolean
include(BeanPropertyWriter writer)

Method called to determine whether property will be included (if 'true' returned) or filtered out (if 'false' returned)

protected boolean
include(PropertyWriter writer)

Method called to determine whether property will be included (if 'true' returned) or filtered out (if 'false' returned)

protected boolean
includeElement(Object elementValue)

Method that defines what to do with container elements (values contained in an array or java.util.Collection: default implementation simply writes them out.

public static SimpleBeanPropertyFilter
serializeAll()
References Deprecated SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

Convenience factory method that will return a "no-op" filter that will simply just serialize all properties that are given, and filter out nothing.

public static SimpleBeanPropertyFilter
serializeAll(Set<String> properties)
Deprecated Since 2.6; to be removed from 2.7

Factory method that was accidentally added in 2.5 with arguments; basically works just as an alias of filterOutAllExcept(Set) which is not very useful.

public static SimpleBeanPropertyFilter
serializeAllExcept(Set<String> properties)
References Deprecated SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

public static SimpleBeanPropertyFilter
serializeAllExcept(String... propertyArray)
References Deprecated SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

public void
serializeAsElement(Object
Element value being serializerd
elementValue
,
JsonGenerator
Generator use for serializing value
jgen
,
SerializerProvider
Provider that can be used for accessing dynamic aspects of serialization processing
provider
,
PropertyWriter
Object called to do actual serialization of the field, if not filtered out
writer
)

Implements com.fasterxml.jackson.databind.ser.PropertyFilter.serializeAsElement.

Method called by container to let the filter decide what to do with given element value: the usual choices are to either filter out (i.e. do nothing) or write using given PropertyWriter, although filters can choose other to do something different altogether.

public void
serializeAsField(Object
Object that contains property value to serialize
bean
,
JsonGenerator
Generator use for serializing value
jgen
,
SerializerProvider
Provider that can be used for accessing dynamic aspects of serialization processing
provider
,
BeanPropertyWriter
Default bean property serializer to use
writer
)

Implements com.fasterxml.jackson.databind.ser.BeanPropertyFilter.serializeAsField.

Deprecated

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.

public void
serializeAsField(Object
Object that contains property value to serialize
pojo
,
JsonGenerator
Generator use for serializing value
jgen
,
SerializerProvider
Provider that can be used for accessing dynamic aspects of serialization processing
provider
,
PropertyWriter
Object called to do actual serialization of the field, if not filtered out
writer
)

Implements com.fasterxml.jackson.databind.ser.PropertyFilter.serializeAsField.

Method called by BeanSerializer to let the 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 PropertyWriter, although filters can choose other to do something different altogether.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SimpleBeanPropertyFilterback to summary
protected SimpleBeanPropertyFilter()

Method Detail

depositSchemaPropertyback to summary
public void depositSchemaProperty(BeanPropertyWriter writer, ObjectNode propertiesNode, SerializerProvider provider) throws JsonMappingException

Implements com.fasterxml.jackson.databind.ser.BeanPropertyFilter.depositSchemaProperty.

Doc from com.fasterxml.jackson.databind.ser.BeanPropertyFilter.depositSchemaProperty.

Deprecated

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);
 }
Parameters
writer:BeanPropertyWriter

Bean property writer to use to create schema value

propertiesNode:ObjectNode

Node which the given property would exist within

provider:SerializerProvider

Provider that can be used for accessing dynamic aspects of serialization processing

Annotations
@Deprecated
@Override
depositSchemaPropertyback to summary
public void depositSchemaProperty(BeanPropertyWriter writer, JsonObjectFormatVisitor objectVisitor, SerializerProvider provider) throws JsonMappingException

Implements com.fasterxml.jackson.databind.ser.BeanPropertyFilter.depositSchemaProperty.

Doc from com.fasterxml.jackson.databind.ser.BeanPropertyFilter.depositSchemaProperty.

Deprecated

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:BeanPropertyWriter

Bean property serializer to use to create schema value

objectVisitor:JsonObjectFormatVisitor

JsonObjectFormatVisitor which should be aware of the property's existence

provider:SerializerProvider

Provider that can be used for accessing dynamic aspects of serialization processing

Annotations
@Deprecated
@Override
depositSchemaPropertyback to summary
public void depositSchemaProperty(PropertyWriter writer, ObjectNode propertiesNode, SerializerProvider provider) throws JsonMappingException

Implements com.fasterxml.jackson.databind.ser.PropertyFilter.depositSchemaProperty.

Doc from com.fasterxml.jackson.databind.ser.PropertyFilter.depositSchemaProperty.

Deprecated

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);
 }
Parameters
writer:PropertyWriter

Bean property writer to use to create schema value

propertiesNode:ObjectNode

Node which the given property would exist within

provider:SerializerProvider

Provider that can be used for accessing dynamic aspects of serialization processing

Annotations
@Deprecated
@Override
depositSchemaPropertyback to summary
public void depositSchemaProperty(PropertyWriter writer, JsonObjectFormatVisitor objectVisitor, SerializerProvider provider) throws JsonMappingException

Implements com.fasterxml.jackson.databind.ser.PropertyFilter.depositSchemaProperty.

Doc from com.fasterxml.jackson.databind.ser.PropertyFilter.depositSchemaProperty.

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:PropertyWriter

Bean property serializer to use to create schema value

objectVisitor:JsonObjectFormatVisitor

JsonObjectFormatVisitor which should be aware of the property's existence

provider:SerializerProvider

Provider that can be used for accessing dynamic aspects of serialization processing

Annotations
@Override
filterOutAllback to summary
public static SimpleBeanPropertyFilter filterOutAll()

References Deprecated

SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Convenience factory method that will return a filter that will simply filter out everything.

Since
2.15
filterOutAllExceptback to summary
public static SimpleBeanPropertyFilter filterOutAllExcept(Set<String> properties)

References Deprecated

SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Factory method to construct filter that filters out all properties except ones includes in set

filterOutAllExceptback to summary
public static SimpleBeanPropertyFilter filterOutAllExcept(String... propertyArray)

References Deprecated

SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

fromback to summary
public static PropertyFilter from(final BeanPropertyFilter src)

References Deprecated

BeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Helper method to ease transition from BeanPropertyWriter into PropertyWriter

Since
2.3
includeback to summary
protected boolean include(BeanPropertyWriter writer)

Method called to determine whether property will be included (if 'true' returned) or filtered out (if 'false' returned)

includeback to summary
protected boolean include(PropertyWriter writer)

Method called to determine whether property will be included (if 'true' returned) or filtered out (if 'false' returned)

Since
2.3
includeElementback to summary
protected boolean includeElement(Object elementValue)

Method that defines what to do with container elements (values contained in an array or java.util.Collection: default implementation simply writes them out.

Since
2.3
serializeAllback to summary
public static SimpleBeanPropertyFilter serializeAll()

References Deprecated

SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Convenience factory method that will return a "no-op" filter that will simply just serialize all properties that are given, and filter out nothing.

Since
2.6
serializeAllback to summary
public static SimpleBeanPropertyFilter serializeAll(Set<String> properties)

Deprecated

Since 2.6; to be removed from 2.7

Factory method that was accidentally added in 2.5 with arguments; basically works just as an alias of filterOutAllExcept(Set) which is not very useful. Instead, see serializeAll() for intended signature.

Annotations
@Deprecated
serializeAllExceptback to summary
public static SimpleBeanPropertyFilter serializeAllExcept(Set<String> properties)

References Deprecated

SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

serializeAllExceptback to summary
public static SimpleBeanPropertyFilter serializeAllExcept(String... propertyArray)

References Deprecated

SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

serializeAsElementback to summary
public void serializeAsElement(Object elementValue, JsonGenerator jgen, SerializerProvider provider, PropertyWriter writer) throws Exception

Implements com.fasterxml.jackson.databind.ser.PropertyFilter.serializeAsElement.

Doc from com.fasterxml.jackson.databind.ser.PropertyFilter.serializeAsElement.

Method called by container to let the filter decide what to do with given element value: the usual choices are to either filter out (i.e. do nothing) or write using given PropertyWriter, although filters can choose other to do something different altogether.

Typical implementation is something like:

 if (include(writer)) {
      writer.serializeAsElement(pojo, gen, prov);
 }
Parameters
elementValue:Object

Element value being serializerd

jgen:JsonGenerator

Generator use for serializing value

provider:SerializerProvider

Provider that can be used for accessing dynamic aspects of serialization processing

writer:PropertyWriter

Object called to do actual serialization of the field, if not filtered out

Annotations
@Override
serializeAsFieldback to summary
public void serializeAsField(Object bean, JsonGenerator jgen, SerializerProvider provider, BeanPropertyWriter writer) throws Exception

Implements com.fasterxml.jackson.databind.ser.BeanPropertyFilter.serializeAsField.

Doc from com.fasterxml.jackson.databind.ser.BeanPropertyFilter.serializeAsField.

Deprecated

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
bean:Object

Object that contains property value to serialize

jgen:JsonGenerator

Generator use for serializing value

provider:SerializerProvider

Provider that can be used for accessing dynamic aspects of serialization processing

writer:BeanPropertyWriter

Default bean property serializer to use

Annotations
@Deprecated
@Override
serializeAsFieldback to summary
public void serializeAsField(Object pojo, JsonGenerator jgen, SerializerProvider provider, PropertyWriter writer) throws Exception

Implements com.fasterxml.jackson.databind.ser.PropertyFilter.serializeAsField.

Doc from com.fasterxml.jackson.databind.ser.PropertyFilter.serializeAsField.

Method called by BeanSerializer to let the 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 PropertyWriter, although filters can choose other to do something different altogether.

Typical implementation is something like:

 if (include(writer)) {
      writer.serializeAsField(pojo, gen, prov);
 }
Parameters
pojo:Object

Object that contains property value to serialize

jgen:JsonGenerator

Generator use for serializing value

provider:SerializerProvider

Provider that can be used for accessing dynamic aspects of serialization processing

writer:PropertyWriter

Object called to do actual serialization of the field, if not filtered out

Annotations
@Override
com.fasterxml.jackson.databind.ser.impl back to summary

public Class SimpleBeanPropertyFilter.FilterExceptFilter

extends SimpleBeanPropertyFilter
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable

References Deprecated

SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Filter implementation which defaults to filtering out unknown properties and only serializes ones explicitly listed.

Field Summary

Modifier and TypeField and Description
protected final Set<String>
_propertiesToInclude

Set of property names to serialize.

pack-priv static final SimpleBeanPropertyFilter.FilterExceptFilter
EXCLUDE_ALL

References Deprecated SimpleBeanPropertyFilter.FilterExceptFilter is deprecated or references (maybe indirectly) at least one deprecated element.
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
include(BeanPropertyWriter writer)

Overrides com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.include.

Method called to determine whether property will be included (if 'true' returned) or filtered out (if 'false' returned)

protected boolean
include(PropertyWriter writer)

Overrides com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.include.

Method called to determine whether property will be included (if 'true' returned) or filtered out (if 'false' returned)

Inherited from com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter:
depositSchemaPropertydepositSchemaPropertydepositSchemaPropertydepositSchemaPropertyfilterOutAllfilterOutAllExceptfilterOutAllExceptfromincludeElementserializeAllserializeAllserializeAllExceptserializeAllExceptserializeAsElementserializeAsFieldserializeAsField

Field Detail

_propertiesToIncludeback to summary
protected final Set<String> _propertiesToInclude

Set of property names to serialize.

EXCLUDE_ALLback to summary
pack-priv static final SimpleBeanPropertyFilter.FilterExceptFilter EXCLUDE_ALL

References Deprecated

SimpleBeanPropertyFilter.FilterExceptFilter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

FilterExceptFilterback to summary
public FilterExceptFilter(Set<String> properties)

Method Detail

includeback to summary
protected boolean include(BeanPropertyWriter writer)

Overrides com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.include.

Doc from com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.include.

Method called to determine whether property will be included (if 'true' returned) or filtered out (if 'false' returned)

Annotations
@Override
includeback to summary
protected boolean include(PropertyWriter writer)

Overrides com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.include.

Doc from com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.include.

Method called to determine whether property will be included (if 'true' returned) or filtered out (if 'false' returned)

Annotations
@Override
com.fasterxml.jackson.databind.ser.impl back to summary

public Class SimpleBeanPropertyFilter.SerializeExceptFilter

extends SimpleBeanPropertyFilter
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable

References Deprecated

SimpleBeanPropertyFilter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Filter implementation which defaults to serializing all properties, except for ones explicitly listed to be filtered out.

Field Summary

Modifier and TypeField and Description
protected final Set<String>
_propertiesToExclude

Set of property names to filter out.

pack-priv static final SimpleBeanPropertyFilter.SerializeExceptFilter
INCLUDE_ALL

References Deprecated SimpleBeanPropertyFilter.SerializeExceptFilter is deprecated or references (maybe indirectly) at least one deprecated element.
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
include(BeanPropertyWriter writer)

Overrides com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.include.

Method called to determine whether property will be included (if 'true' returned) or filtered out (if 'false' returned)

protected boolean
include(PropertyWriter writer)

Overrides com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.include.

Method called to determine whether property will be included (if 'true' returned) or filtered out (if 'false' returned)

Inherited from com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter:
depositSchemaPropertydepositSchemaPropertydepositSchemaPropertydepositSchemaPropertyfilterOutAllfilterOutAllExceptfilterOutAllExceptfromincludeElementserializeAllserializeAllserializeAllExceptserializeAllExceptserializeAsElementserializeAsFieldserializeAsField

Field Detail

_propertiesToExcludeback to summary
protected final Set<String> _propertiesToExclude

Set of property names to filter out.

INCLUDE_ALLback to summary
pack-priv static final SimpleBeanPropertyFilter.SerializeExceptFilter INCLUDE_ALL

References Deprecated

SimpleBeanPropertyFilter.SerializeExceptFilter is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

SerializeExceptFilterback to summary
public SerializeExceptFilter(Set<String> properties)

Method Detail

includeback to summary
protected boolean include(BeanPropertyWriter writer)

Overrides com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.include.

Doc from com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.include.

Method called to determine whether property will be included (if 'true' returned) or filtered out (if 'false' returned)

Annotations
@Override
includeback to summary
protected boolean include(PropertyWriter writer)

Overrides com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.include.

Doc from com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter.include.

Method called to determine whether property will be included (if 'true' returned) or filtered out (if 'false' returned)

Annotations
@Override