public class MapProperty extends PropertyWriter
Maps
are not handled as a collection of properties by Jackson (unlike POJOs),
bit more wrapping is required.BeanProperty.Bogus, BeanProperty.StdEMPTY_FORMAT, EMPTY_INCLUDE| Constructor and Description |
|---|
MapProperty(TypeSerializer typeSer,
BeanProperty prop) |
| Modifier and Type | Method and Description |
|---|---|
void |
depositSchemaProperty(JsonObjectFormatVisitor objectVisitor,
SerializerProvider provider)
Traversal method used for things like JSON Schema generation, or
POJO introspection.
|
void |
depositSchemaProperty(ObjectNode propertiesNode,
SerializerProvider provider)
Deprecated.
|
<A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<A> acls)
Method for accessing annotations directly declared for property that this
writer is associated with.
|
<A extends java.lang.annotation.Annotation> |
getContextAnnotation(java.lang.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()
Method for getting full name definition, including possible
format-specific additional properties (such as namespace when
using XML backend).
|
AnnotatedMember |
getMember()
Method for accessing primary physical entity that represents the property;
annotated field, method or constructor property.
|
java.lang.String |
getName()
Method to get logical name of the property
|
JavaType |
getType()
Method to get declared type of the property.
|
java.lang.Object |
getValue() |
PropertyName |
getWrapperName()
If property is indicated to be wrapped, name of
wrapper element to use.
|
void |
reset(java.lang.Object key,
JsonSerializer<java.lang.Object> keySer,
JsonSerializer<java.lang.Object> valueSer)
Deprecated.
|
void |
reset(java.lang.Object key,
java.lang.Object value,
JsonSerializer<java.lang.Object> keySer,
JsonSerializer<java.lang.Object> valueSer)
Initialization method that needs to be called before passing
property to filter.
|
void |
serializeAsElement(java.lang.Object map,
JsonGenerator gen,
SerializerProvider provider)
Serialization method called when output is to be done as an array,
that is, not using property names.
|
void |
serializeAsField(java.lang.Object map,
JsonGenerator gen,
SerializerProvider provider)
The main serialization method called by filter when property is to be written normally.
|
void |
serializeAsOmittedField(java.lang.Object map,
JsonGenerator gen,
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(java.lang.Object value,
JsonGenerator gen,
SerializerProvider provider)
Serialization method called when doing tabular (positional) output from databind,
but then value is to be omitted.
|
void |
setValue(java.lang.Object v) |
findAnnotationfindAliases, findFormatOverrides, findPropertyFormat, findPropertyInclusion, getMetadata, isRequired, isVirtualpublic MapProperty(TypeSerializer typeSer, BeanProperty prop)
public void reset(java.lang.Object key,
java.lang.Object value,
JsonSerializer<java.lang.Object> keySer,
JsonSerializer<java.lang.Object> valueSer)
@Deprecated
public void reset(java.lang.Object key,
JsonSerializer<java.lang.Object> keySer,
JsonSerializer<java.lang.Object> valueSer)
public java.lang.String getName()
BeanPropertygetName in interface BeanPropertygetName in interface NamedgetName in class PropertyWriterpublic java.lang.Object getValue()
public void setValue(java.lang.Object v)
public PropertyName getFullName()
BeanPropertygetFullName in interface BeanPropertygetFullName in class PropertyWriterpublic <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> acls)
PropertyWritergetAnnotation in interface BeanPropertygetAnnotation in class PropertyWriterpublic <A extends java.lang.annotation.Annotation> A getContextAnnotation(java.lang.Class<A> acls)
PropertyWritergetContextAnnotation in interface BeanPropertygetContextAnnotation in class PropertyWriterpublic void serializeAsField(java.lang.Object map,
JsonGenerator gen,
SerializerProvider provider)
throws java.io.IOException
PropertyWriterserializeAsField in class PropertyWriterjava.io.IOExceptionpublic void serializeAsOmittedField(java.lang.Object map,
JsonGenerator gen,
SerializerProvider provider)
throws java.lang.Exception
PropertyWriterserializeAsOmittedField in class PropertyWriterjava.lang.Exceptionpublic void serializeAsElement(java.lang.Object map,
JsonGenerator gen,
SerializerProvider provider)
throws java.lang.Exception
PropertyWriterCollection, 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 PropertyWriterjava.lang.Exceptionpublic void serializeAsPlaceholder(java.lang.Object value,
JsonGenerator gen,
SerializerProvider provider)
throws java.lang.Exception
PropertyWriterPropertyWriter.serializeAsOmittedField(java.lang.Object, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider).serializeAsPlaceholder in class PropertyWriterjava.lang.Exceptionpublic void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializerProvider provider) throws JsonMappingException
PropertyWriterdepositSchemaProperty in interface BeanPropertydepositSchemaProperty in class PropertyWriterobjectVisitor - Visitor to used as the callback handlerJsonMappingException@Deprecated public void depositSchemaProperty(ObjectNode propertiesNode, SerializerProvider provider) throws JsonMappingException
PropertyWriterdepositSchemaProperty in class PropertyWriterJsonMappingExceptionpublic JavaType getType()
BeanPropertypublic PropertyName getWrapperName()
BeanPropertypublic AnnotatedMember getMember()
BeanPropertyCopyright © 2010 - 2023 Adobe. All Rights Reserved