public class MapProperty extends PropertyWriter
Map
s
are not handled as a collection of properties by Jackson (unlike POJOs),
bit more wrapping is required.Modifier and Type | Field and Description |
---|---|
protected Object |
_key |
protected JsonSerializer<Object> |
_keySerializer |
protected TypeSerializer |
_typeSerializer |
protected Object |
_value |
protected JsonSerializer<Object> |
_valueSerializer |
Constructor and Description |
---|
MapProperty(TypeSerializer typeSer) |
Modifier and Type | Method and Description |
---|---|
void |
depositSchemaProperty(JsonObjectFormatVisitor objectVisitor)
Traversal method used for things like JSON Schema generation, or
POJO introspection.
|
void |
depositSchemaProperty(ObjectNode propertiesNode,
SerializerProvider provider)
Deprecated.
|
PropertyName |
getFullName() |
String |
getName() |
void |
reset(Object key,
Object value,
JsonSerializer<Object> keySer,
JsonSerializer<Object> valueSer)
Initialization method that needs to be called before passing
property to filter.
|
void |
serializeAsElement(Object pojo,
JsonGenerator jgen,
SerializerProvider provider)
Serialization method called when output is to be done as an array,
that is, not using property names.
|
void |
serializeAsField(Object pojo,
JsonGenerator jgen,
SerializerProvider provider)
The main serialization method called by filter when property is to be written normally.
|
void |
serializeAsOmittedField(Object pojo,
JsonGenerator jgen,
SerializerProvider provider)
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.
|
void |
serializeAsPlaceholder(Object pojo,
JsonGenerator jgen,
SerializerProvider provider)
Serialization method called when doing tabular (positional) output from databind,
but then value is to be omitted.
|
protected TypeSerializer _typeSerializer
protected Object _key
protected Object _value
protected JsonSerializer<Object> _keySerializer
protected JsonSerializer<Object> _valueSerializer
public MapProperty(TypeSerializer typeSer)
public void reset(Object key, Object value, JsonSerializer<Object> keySer, JsonSerializer<Object> valueSer)
public String getName()
getName
in class PropertyWriter
public PropertyName getFullName()
getFullName
in class PropertyWriter
public void serializeAsField(Object pojo, JsonGenerator jgen, SerializerProvider provider) throws IOException
PropertyWriter
serializeAsField
in class PropertyWriter
IOException
public void serializeAsOmittedField(Object pojo, JsonGenerator jgen, SerializerProvider provider) throws Exception
PropertyWriter
serializeAsOmittedField
in class PropertyWriter
Exception
public void serializeAsElement(Object pojo, JsonGenerator jgen, SerializerProvider provider) throws Exception
PropertyWriter
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.
serializeAsElement
in class PropertyWriter
Exception
public void serializeAsPlaceholder(Object pojo, JsonGenerator jgen, SerializerProvider provider) throws Exception
PropertyWriter
PropertyWriter.serializeAsOmittedField(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider)
.serializeAsPlaceholder
in class PropertyWriter
Exception
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor) throws JsonMappingException
PropertyWriter
depositSchemaProperty
in class PropertyWriter
JsonMappingException
@Deprecated public void depositSchemaProperty(ObjectNode propertiesNode, SerializerProvider provider) throws JsonMappingException
PropertyWriter
depositSchemaProperty
in class PropertyWriter
JsonMappingException
Copyright © 2014 FasterXML. All Rights Reserved.