java.lang.Object
tools.jackson.databind.introspect.ConcreteBeanPropertyBase
tools.jackson.databind.ser.PropertyWriter
tools.jackson.databind.ser.jdk.MapProperty
- All Implemented Interfaces:
Serializable
,Named
,BeanProperty
,FullyNamed
Helper class needed to support flexible filtering of Map properties
with generic JSON Filter functionality. Since
Map
s
are not handled as a collection of properties by Jackson (unlike POJOs),
bit more wrapping is required.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface tools.jackson.databind.BeanProperty
BeanProperty.Bogus, BeanProperty.Std
Nested classes/interfaces inherited from interface tools.jackson.core.util.Named
Named.StringAsNamed
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Object
protected ValueSerializer<Object>
protected final BeanProperty
protected final TypeSerializer
protected Object
protected ValueSerializer<Object>
Fields inherited from class tools.jackson.databind.introspect.ConcreteBeanPropertyBase
_aliases, _metadata
Fields inherited from interface tools.jackson.databind.BeanProperty
EMPTY_FORMAT, EMPTY_INCLUDE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
depositSchemaProperty
(JsonObjectFormatVisitor objectVisitor, SerializationContext provider) Traversal method used for things like JSON Schema generation, or POJO introspection.<A extends Annotation>
AgetAnnotation
(Class<A> acls) Method for accessing annotations directly declared for property that this writer is associated with.<A extends Annotation>
AgetContextAnnotation
(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.Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.getName()
getType()
Method to get declared type of the property.getValue()
If property is indicated to be wrapped, name of wrapper element to use.void
reset
(Object key, Object value, ValueSerializer<Object> keySer, ValueSerializer<Object> valueSer) Initialization method that needs to be called before passing property to filter.void
serializeAsElement
(Object map, JsonGenerator gen, SerializationContext provider) Serialization method called when output is to be done as an array, that is, not using property names.void
serializeAsOmittedElement
(Object value, JsonGenerator gen, SerializationContext provider) Serialization method called when doing tabular (positional) output from databind, but then value is to be omitted.void
serializeAsOmittedProperty
(Object map, JsonGenerator gen, SerializationContext provider) 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.void
serializeAsProperty
(Object map, JsonGenerator gen, SerializationContext provider) The main serialization method called by filter when property is to be written as an Object property.void
Methods inherited from class tools.jackson.databind.ser.PropertyWriter
findAnnotation
Methods inherited from class tools.jackson.databind.introspect.ConcreteBeanPropertyBase
findAliases, findFormatOverrides, findPropertyFormat, findPropertyInclusion, getMetadata, isRequired, isVirtual
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface tools.jackson.databind.util.FullyNamed
hasName
-
Field Details
-
_typeSerializer
-
_property
-
_key
-
_value
-
_keySerializer
-
_valueSerializer
-
-
Constructor Details
-
MapProperty
-
-
Method Details
-
reset
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. -
getName
- Specified by:
getName
in interfaceNamed
- Specified by:
getName
in classPropertyWriter
-
getValue
-
setValue
-
getFullName
- Specified by:
getFullName
in interfaceFullyNamed
- Specified by:
getFullName
in classPropertyWriter
-
getAnnotation
Description copied from class:PropertyWriter
Method for accessing annotations directly declared for property that this writer is associated with.- Specified by:
getAnnotation
in interfaceBeanProperty
- Specified by:
getAnnotation
in classPropertyWriter
-
getContextAnnotation
Description copied from class:PropertyWriter
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.- Specified by:
getContextAnnotation
in interfaceBeanProperty
- Specified by:
getContextAnnotation
in classPropertyWriter
-
serializeAsProperty
Description copied from class:PropertyWriter
The main serialization method called by filter when property is to be written as an Object property.- Specified by:
serializeAsProperty
in classPropertyWriter
-
serializeAsOmittedProperty
public void serializeAsOmittedProperty(Object map, JsonGenerator gen, SerializationContext provider) Description copied from class:PropertyWriter
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.- Specified by:
serializeAsOmittedProperty
in classPropertyWriter
-
serializeAsElement
Description copied from class:PropertyWriter
Serialization method called when output is to be done as an array, that is, not using property names. This is needed when serializing container (Collection
, array) types, or POJOs usingtabular
("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.
- Specified by:
serializeAsElement
in classPropertyWriter
-
serializeAsOmittedElement
public void serializeAsOmittedElement(Object value, JsonGenerator gen, SerializationContext provider) Description copied from class:PropertyWriter
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 toPropertyWriter.serializeAsOmittedProperty(java.lang.Object, tools.jackson.core.JsonGenerator, tools.jackson.databind.SerializationContext)
.- Specified by:
serializeAsOmittedElement
in classPropertyWriter
-
depositSchemaProperty
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializationContext provider) Description copied from class:PropertyWriter
Traversal method used for things like JSON Schema generation, or POJO introspection.- Specified by:
depositSchemaProperty
in interfaceBeanProperty
- Specified by:
depositSchemaProperty
in classPropertyWriter
- Parameters:
objectVisitor
- Visitor to used as the callback handler
-
getType
Description copied from interface:BeanProperty
Method to get declared type of the property. -
getWrapperName
Description copied from interface:BeanProperty
If property is indicated to be wrapped, name of wrapper element to use. -
getMember
Description copied from interface:BeanProperty
Method for accessing primary physical entity that represents the property; annotated field, method or constructor property.
-