java.lang.Object
tools.jackson.databind.introspect.ConcreteBeanPropertyBase
tools.jackson.databind.ser.PropertyWriter
tools.jackson.databind.ser.jdk.MapProperty
- All Implemented Interfaces:
Named,BeanProperty,FullyNamed
Helper class needed to support flexible filtering of Map properties
with generic JSON Filter functionality. Since
Maps
are not handled as a collection of properties by Jackson (unlike POJOs),
bit more wrapping is required.-
Nested Class Summary
Nested classes/interfaces inherited from interface tools.jackson.databind.BeanProperty
BeanProperty.Bogus, BeanProperty.StdNested classes/interfaces inherited from interface tools.jackson.core.util.Named
Named.StringAsNamed -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Objectprotected ValueSerializer<Object>protected final BeanPropertyprotected final TypeSerializerprotected Objectprotected ValueSerializer<Object>Fields inherited from class tools.jackson.databind.introspect.ConcreteBeanPropertyBase
_aliases, _metadataFields inherited from interface tools.jackson.databind.BeanProperty
EMPTY_FORMAT, EMPTY_INCLUDE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddepositSchemaProperty(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.voidreset(Object key, Object value, ValueSerializer<Object> keySer, ValueSerializer<Object> valueSer) Initialization method that needs to be called before passing property to filter.voidserializeAsElement(Object map, JsonGenerator gen, SerializationContext provider) Serialization method called when output is to be done as an array, that is, not using property names.voidserializeAsOmittedElement(Object value, JsonGenerator gen, SerializationContext provider) Serialization method called when doing tabular (positional) output from databind, but then value is to be omitted.voidserializeAsOmittedProperty(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.voidserializeAsProperty(Object map, JsonGenerator gen, SerializationContext provider) The main serialization method called by filter when property is to be written as an Object property.voidMethods inherited from class tools.jackson.databind.ser.PropertyWriter
findAnnotationMethods inherited from class tools.jackson.databind.introspect.ConcreteBeanPropertyBase
findAliases, findFormatOverrides, findPropertyFormat, findPropertyInclusion, getMetadata, isRequired, isVirtualMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getNamein interfaceNamed- Specified by:
getNamein classPropertyWriter
-
getValue
-
setValue
-
getFullName
- Specified by:
getFullNamein interfaceFullyNamed- Specified by:
getFullNamein classPropertyWriter
-
getAnnotation
Description copied from class:PropertyWriterMethod for accessing annotations directly declared for property that this writer is associated with.- Specified by:
getAnnotationin interfaceBeanProperty- Specified by:
getAnnotationin classPropertyWriter
-
getContextAnnotation
Description copied from class:PropertyWriterMethod 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:
getContextAnnotationin interfaceBeanProperty- Specified by:
getContextAnnotationin classPropertyWriter
-
serializeAsProperty
Description copied from class:PropertyWriterThe main serialization method called by filter when property is to be written as an Object property.- Specified by:
serializeAsPropertyin classPropertyWriter
-
serializeAsOmittedProperty
public void serializeAsOmittedProperty(Object map, JsonGenerator gen, SerializationContext provider) Description copied from class:PropertyWriterSerialization 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:
serializeAsOmittedPropertyin classPropertyWriter
-
serializeAsElement
Description copied from class:PropertyWriterSerialization 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:
serializeAsElementin classPropertyWriter
-
serializeAsOmittedElement
public void serializeAsOmittedElement(Object value, JsonGenerator gen, SerializationContext provider) Description copied from class:PropertyWriterSerialization 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:
serializeAsOmittedElementin classPropertyWriter
-
depositSchemaProperty
public void depositSchemaProperty(JsonObjectFormatVisitor objectVisitor, SerializationContext provider) Description copied from class:PropertyWriterTraversal method used for things like JSON Schema generation, or POJO introspection.- Specified by:
depositSchemaPropertyin interfaceBeanProperty- Specified by:
depositSchemaPropertyin classPropertyWriter- Parameters:
objectVisitor- Visitor to used as the callback handler
-
getType
Description copied from interface:BeanPropertyMethod to get declared type of the property. -
getWrapperName
Description copied from interface:BeanPropertyIf property is indicated to be wrapped, name of wrapper element to use. -
getMember
Description copied from interface:BeanPropertyMethod for accessing primary physical entity that represents the property; annotated field, method or constructor property.
-