Top Description Fields Constructors Methods
tools.jackson.databind.ser.jdk

public Class MapProperty

extends PropertyWriter
Class Inheritance
Imports
java.lang.annotation.Annotation, tools.jackson.core.JsonGenerator, tools.jackson.databind.*, tools.jackson.databind.introspect.AnnotatedMember, tools.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.ser.PropertyWriter

Helper class needed to support flexible filtering of Map properties with generic JSON Filter functionality. Since java.util.Maps are not handled as a collection of properties by Jackson (unlike POJOs), bit more wrapping is required.

Field Summary

Modifier and TypeField and Description
protected Object
protected ValueSerializer<Object>
protected final BeanProperty
protected final TypeSerializer
protected Object
protected ValueSerializer<Object>
private static final BeanProperty

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializationContext provider)

Implements abstract tools.jackson.databind.ser.PropertyWriter.depositSchemaProperty.

Implements tools.jackson.databind.BeanProperty.depositSchemaProperty.

Traversal method used for things like JSON Schema generation, or POJO introspection.

public <A extends Annotation> A
getAnnotation(Class<A> acls)

Implements abstract tools.jackson.databind.ser.PropertyWriter.getAnnotation.

Implements tools.jackson.databind.BeanProperty.getAnnotation.

Method for accessing annotations directly declared for property that this writer is associated with.

public <A extends Annotation> A
getContextAnnotation(Class<A> acls)

Implements abstract tools.jackson.databind.ser.PropertyWriter.getContextAnnotation.

Implements tools.jackson.databind.BeanProperty.getContextAnnotation.

Method for accessing annotations declared in context of the property that this writer is associated with; usually this means annotations on enclosing class for property.

public PropertyName
public AnnotatedMember
getMember()

Implements tools.jackson.databind.BeanProperty.getMember.

Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.

public String
public JavaType
getType()

Implements tools.jackson.databind.BeanProperty.getType.

Method to get declared type of the property.

public Object
public PropertyName
getWrapperName()

Implements tools.jackson.databind.BeanProperty.getWrapperName.

If property is indicated to be wrapped, name of wrapper element to use.

public void
reset(Object key, Object value, ValueSerializer<Object> keySer, ValueSerializer<Object> valueSer)

Initialization method that needs to be called before passing property to filter.

public void
serializeAsElement(Object map, JsonGenerator gen, SerializationContext provider)

Implements abstract tools.jackson.databind.ser.PropertyWriter.serializeAsElement.

Serialization method called when output is to be done as an array, that is, not using property names.

public void
serializeAsOmittedElement(Object value, JsonGenerator gen, SerializationContext provider)

Implements abstract tools.jackson.databind.ser.PropertyWriter.serializeAsOmittedElement.

Serialization method called when doing tabular (positional) output from databind, but then value is to be omitted.

public void
serializeAsOmittedProperty(Object map, JsonGenerator gen, SerializationContext provider)

Implements abstract tools.jackson.databind.ser.PropertyWriter.serializeAsOmittedProperty.

Serialization method that filter needs to call in cases where a property value (key, value) is to be filtered, but the underlying data format requires a placeholder of some kind.

public void
serializeAsProperty(Object map, JsonGenerator gen, SerializationContext provider)

Implements abstract tools.jackson.databind.ser.PropertyWriter.serializeAsProperty.

The main serialization method called by filter when property is to be written as an Object property.

public void
Inherited from tools.jackson.databind.ser.PropertyWriter:
findAnnotation

Field Detail

_keyback to summary
protected Object _key
_keySerializerback to summary
protected ValueSerializer<Object> _keySerializer
_propertyback to summary
protected final BeanProperty _property
_typeSerializerback to summary
protected final TypeSerializer _typeSerializer
_valueback to summary
protected Object _value
_valueSerializerback to summary
protected ValueSerializer<Object> _valueSerializer
BOGUS_PROPback to summary
private static final BeanProperty BOGUS_PROP

Constructor Detail

MapPropertyback to summary
public MapProperty(TypeSerializer typeSer, BeanProperty prop)

Method Detail

depositSchemaPropertyback to summary
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializationContext provider)

Implements abstract tools.jackson.databind.ser.PropertyWriter.depositSchemaProperty.

Implements tools.jackson.databind.BeanProperty.depositSchemaProperty.

Doc from tools.jackson.databind.ser.PropertyWriter.depositSchemaProperty.

Traversal method used for things like JSON Schema generation, or POJO introspection.

Annotations
@Override
getAnnotationback to summary
public <A extends Annotation> A getAnnotation(Class<A> acls)

Implements abstract tools.jackson.databind.ser.PropertyWriter.getAnnotation.

Implements tools.jackson.databind.BeanProperty.getAnnotation.

Doc from tools.jackson.databind.ser.PropertyWriter.getAnnotation.

Method for accessing annotations directly declared for property that this writer is associated with.

Annotations
@Override
getContextAnnotationback to summary
public <A extends Annotation> A getContextAnnotation(Class<A> acls)

Implements abstract tools.jackson.databind.ser.PropertyWriter.getContextAnnotation.

Implements tools.jackson.databind.BeanProperty.getContextAnnotation.

Doc from tools.jackson.databind.ser.PropertyWriter.getContextAnnotation.

Method for accessing annotations declared in context of the property that this writer is associated with; usually this means annotations on enclosing class for property.

Annotations
@Override
getFullNameback to summary
public PropertyName getFullName()

Implements abstract tools.jackson.databind.ser.PropertyWriter.getFullName.

Implements tools.jackson.databind.util.FullyNamed.getFullName.

Annotations
@Override
getMemberback to summary
public AnnotatedMember getMember()

Implements tools.jackson.databind.BeanProperty.getMember.

Doc from tools.jackson.databind.BeanProperty.getMember.

Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.

Annotations
@Override
getNameback to summary
public String getName()

Implements abstract tools.jackson.databind.ser.PropertyWriter.getName.

Implements tools.jackson.core.util.Named.getName.

Annotations
@Override
getTypeback to summary
public JavaType getType()

Implements tools.jackson.databind.BeanProperty.getType.

Doc from tools.jackson.databind.BeanProperty.getType.

Method to get declared type of the property.

Annotations
@Override
getValueback to summary
public Object getValue()
getWrapperNameback to summary
public PropertyName getWrapperName()

Implements tools.jackson.databind.BeanProperty.getWrapperName.

Doc from tools.jackson.databind.BeanProperty.getWrapperName.

If property is indicated to be wrapped, name of wrapper element to use.

Annotations
@Override
resetback to summary
public void reset(Object key, Object value, ValueSerializer<Object> keySer, ValueSerializer<Object> valueSer)

Initialization method that needs to be called before passing property to filter.

serializeAsElementback to summary
public void serializeAsElement(Object map, JsonGenerator gen, SerializationContext provider)

Implements abstract tools.jackson.databind.ser.PropertyWriter.serializeAsElement.

Doc from tools.jackson.databind.ser.PropertyWriter.serializeAsElement.

Serialization method called when output is to be done as an array, that is, not using property names. This is needed when serializing container (java.util.Collection, array) types, or POJOs using tabular ("as array") output format.

Note that this mode of operation is independent of underlying data format; so it is typically NOT called for fully tabular formats such as CSV, where logical output is still as form of POJOs.

Annotations
@Override
serializeAsOmittedElementback to summary
public void serializeAsOmittedElement(Object value, JsonGenerator gen, SerializationContext provider)

Implements abstract tools.jackson.databind.ser.PropertyWriter.serializeAsOmittedElement.

Doc from tools.jackson.databind.ser.PropertyWriter.serializeAsOmittedElement.

Serialization method called when doing tabular (positional) output from databind, but then value is to be omitted. This requires output of a placeholder value of some sort; often similar to serializeAsOmittedProperty.

Annotations
@Override
serializeAsOmittedPropertyback to summary
public void serializeAsOmittedProperty(Object map, JsonGenerator gen, SerializationContext provider)

Implements abstract tools.jackson.databind.ser.PropertyWriter.serializeAsOmittedProperty.

Doc from tools.jackson.databind.ser.PropertyWriter.serializeAsOmittedProperty.

Serialization method that filter needs to call in cases where a property value (key, value) is to be filtered, but the underlying data format requires a placeholder of some kind. This is usually the case for tabular (positional) data formats such as CSV.

Annotations
@Override
serializeAsPropertyback to summary
public void serializeAsProperty(Object map, JsonGenerator gen, SerializationContext provider)

Implements abstract tools.jackson.databind.ser.PropertyWriter.serializeAsProperty.

Doc from tools.jackson.databind.ser.PropertyWriter.serializeAsProperty.

The main serialization method called by filter when property is to be written as an Object property.

Annotations
@Override
setValueback to summary
public void setValue(Object v)