Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.ser.std

public Class MapProperty

extends PropertyWriter
Class Inheritance
Imports
java.io.IOException, java.lang.annotation.Annotation, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.introspect.AnnotatedMember, com.fasterxml.jackson.databind.jsonFormatVisitors.JsonObjectFormatVisitor, com.fasterxml.jackson.databind.jsontype.TypeSerializer, com.fasterxml.jackson.databind.node.ObjectNode, com.fasterxml.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 JsonSerializer<Object>
protected final BeanProperty
protected final TypeSerializer
protected Object
protected JsonSerializer<Object>
private static final BeanProperty
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
depositSchemaProperty(JsonObjectFormatVisitor
Visitor to used as the callback handler
objectVisitor
,
SerializerProvider provider)

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.depositSchemaProperty.

Implements com.fasterxml.jackson.databind.BeanProperty.depositSchemaProperty.

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

public void
depositSchemaProperty(ObjectNode propertiesNode, SerializerProvider provider)

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.depositSchemaProperty.

Deprecated

Legacy method called for JSON Schema generation; should not be called by new code

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

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.getAnnotation.

Implements com.fasterxml.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 com.fasterxml.jackson.databind.ser.PropertyWriter.getContextAnnotation.

Implements com.fasterxml.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
getFullName()

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.getFullName.

Implements com.fasterxml.jackson.databind.BeanProperty.getFullName.

Method for getting full name definition, including possible format-specific additional properties (such as namespace when using XML backend).

public AnnotatedMember
getMember()

Implements com.fasterxml.jackson.databind.BeanProperty.getMember.

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

public String
getName()

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.getName.

Implements com.fasterxml.jackson.databind.BeanProperty.getName.

Method to get logical name of the property

public JavaType
getType()

Implements com.fasterxml.jackson.databind.BeanProperty.getType.

Method to get declared type of the property.

public Object
public PropertyName
getWrapperName()

Implements com.fasterxml.jackson.databind.BeanProperty.getWrapperName.

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

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

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

public void
reset(Object key, JsonSerializer<Object> keySer, JsonSerializer<Object> valueSer)
Deprecated

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

Implements abstract com.fasterxml.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
serializeAsField(Object map, JsonGenerator gen, SerializerProvider provider)

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.serializeAsField.

The main serialization method called by filter when property is to be written normally.

public void
serializeAsOmittedField(Object map, JsonGenerator gen, SerializerProvider provider)

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.serializeAsOmittedField.

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

public void
serializeAsPlaceholder(Object value, JsonGenerator gen, SerializerProvider provider)

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.serializeAsPlaceholder.

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

public void
Inherited from com.fasterxml.jackson.databind.ser.PropertyWriter:
findAnnotation

Field Detail

_keyback to summary
protected Object _key
_keySerializerback to summary
protected JsonSerializer<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 JsonSerializer<Object> _valueSerializer
BOGUS_PROPback to summary
private static final BeanProperty BOGUS_PROP
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.ser.PropertyWriter.serialVersionUID.

Constructor Detail

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

Method Detail

depositSchemaPropertyback to summary
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializerProvider provider) throws JsonMappingException

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.depositSchemaProperty.

Implements com.fasterxml.jackson.databind.BeanProperty.depositSchemaProperty.

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

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

Parameters
objectVisitor:JsonObjectFormatVisitor

Doc from com.fasterxml.jackson.databind.BeanProperty.depositSchemaProperty.

Visitor to used as the callback handler

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

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.depositSchemaProperty.

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

Deprecated

Legacy method called for JSON Schema generation; should not be called by new code

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

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.getAnnotation.

Implements com.fasterxml.jackson.databind.BeanProperty.getAnnotation.

Doc from com.fasterxml.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 com.fasterxml.jackson.databind.ser.PropertyWriter.getContextAnnotation.

Implements com.fasterxml.jackson.databind.BeanProperty.getContextAnnotation.

Doc from com.fasterxml.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 com.fasterxml.jackson.databind.ser.PropertyWriter.getFullName.

Implements com.fasterxml.jackson.databind.BeanProperty.getFullName.

Doc from com.fasterxml.jackson.databind.BeanProperty.getFullName.

Method for getting full name definition, including possible format-specific additional properties (such as namespace when using XML backend).

Annotations
@Override
getMemberback to summary
public AnnotatedMember getMember()

Implements com.fasterxml.jackson.databind.BeanProperty.getMember.

Doc from com.fasterxml.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 com.fasterxml.jackson.databind.ser.PropertyWriter.getName.

Implements com.fasterxml.jackson.databind.BeanProperty.getName.

Doc from com.fasterxml.jackson.databind.BeanProperty.getName.

Method to get logical name of the property

Annotations
@Override
getTypeback to summary
public JavaType getType()

Implements com.fasterxml.jackson.databind.BeanProperty.getType.

Doc from com.fasterxml.jackson.databind.BeanProperty.getType.

Method to get declared type of the property.

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

Implements com.fasterxml.jackson.databind.BeanProperty.getWrapperName.

Doc from com.fasterxml.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, JsonSerializer<Object> keySer, JsonSerializer<Object> valueSer)

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

Since
2.9
resetback to summary
public void reset(Object key, JsonSerializer<Object> keySer, JsonSerializer<Object> valueSer)

Deprecated

Annotations
@Deprecated
serializeAsElementback to summary
public void serializeAsElement(Object map, JsonGenerator gen, SerializerProvider provider) throws Exception

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.serializeAsElement.

Doc from com.fasterxml.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
serializeAsFieldback to summary
public void serializeAsField(Object map, JsonGenerator gen, SerializerProvider provider) throws IOException

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.serializeAsField.

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

The main serialization method called by filter when property is to be written normally.

Annotations
@Override
serializeAsOmittedFieldback to summary
public void serializeAsOmittedField(Object map, JsonGenerator gen, SerializerProvider provider) throws Exception

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.serializeAsOmittedField.

Doc from com.fasterxml.jackson.databind.ser.PropertyWriter.serializeAsOmittedField.

Serialization method that filter needs to call in cases where property 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
serializeAsPlaceholderback to summary
public void serializeAsPlaceholder(Object value, JsonGenerator gen, SerializerProvider provider) throws Exception

Implements abstract com.fasterxml.jackson.databind.ser.PropertyWriter.serializeAsPlaceholder.

Doc from com.fasterxml.jackson.databind.ser.PropertyWriter.serializeAsPlaceholder.

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 serializeAsOmittedField.

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