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 BeanProperty |
_property |
protected TypeSerializer |
_typeSerializer |
protected JsonSerializer<Object> |
_valueSerializer |
Constructor and Description |
---|
MapProperty(TypeSerializer typeSer)
Deprecated.
since 2.4
|
MapProperty(TypeSerializer typeSer,
BeanProperty prop) |
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.
|
<A extends Annotation> |
getAnnotation(Class<A> acls)
Method for accessing annotations directly declared for property that this
writer is associated with.
|
<A extends Annotation> |
getContextAnnotation(Class<A> acls)
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.
|
PropertyName |
getFullName() |
String |
getName() |
void |
reset(Object key,
JsonSerializer<Object> keySer,
JsonSerializer<Object> valueSer)
Initialization method that needs to be called before passing
property to filter.
|
void |
reset(Object key,
Object value,
JsonSerializer<Object> keySer,
JsonSerializer<Object> valueSer)
Deprecated.
Since 2.5, remove in 2.6
|
void |
serializeAsElement(Object value,
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 value,
JsonGenerator jgen,
SerializerProvider provider)
The main serialization method called by filter when property is to be written normally.
|
void |
serializeAsOmittedField(Object value,
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 value,
JsonGenerator jgen,
SerializerProvider provider)
Serialization method called when doing tabular (positional) output from databind,
but then value is to be omitted.
|
findAnnotation
protected final TypeSerializer _typeSerializer
protected final BeanProperty _property
protected Object _key
protected JsonSerializer<Object> _keySerializer
protected JsonSerializer<Object> _valueSerializer
@Deprecated public MapProperty(TypeSerializer typeSer)
public MapProperty(TypeSerializer typeSer, BeanProperty prop)
@Deprecated public void reset(Object key, Object value, JsonSerializer<Object> keySer, JsonSerializer<Object> valueSer)
public void reset(Object key, JsonSerializer<Object> keySer, JsonSerializer<Object> valueSer)
public String getName()
getName
in class PropertyWriter
public PropertyName getFullName()
getFullName
in class PropertyWriter
public <A extends Annotation> A getAnnotation(Class<A> acls)
PropertyWriter
getAnnotation
in class PropertyWriter
public <A extends Annotation> A getContextAnnotation(Class<A> acls)
PropertyWriter
getContextAnnotation
in class PropertyWriter
public void serializeAsField(Object value, JsonGenerator jgen, SerializerProvider provider) throws IOException
PropertyWriter
serializeAsField
in class PropertyWriter
IOException
public void serializeAsOmittedField(Object value, JsonGenerator jgen, SerializerProvider provider) throws Exception
PropertyWriter
serializeAsOmittedField
in class PropertyWriter
Exception
public void serializeAsElement(Object value, 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 value, 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 © 2016 JBoss by Red Hat. All rights reserved.