Module tools.jackson.databind
Package tools.jackson.databind.ser.bean
Class UnwrappingBeanPropertyWriter
java.lang.Object
tools.jackson.databind.introspect.ConcreteBeanPropertyBase
tools.jackson.databind.ser.PropertyWriter
tools.jackson.databind.ser.BeanPropertyWriter
tools.jackson.databind.ser.bean.UnwrappingBeanPropertyWriter
- All Implemented Interfaces:
Named,BeanProperty,FullyNamed
Variant of
BeanPropertyWriter which will handle unwrapping
of JSON Object (including of properties of Object within surrounding
JSON object, and not as sub-object).-
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 final NameTransformerTransformer used to add prefix and/or suffix for properties of unwrapped POJO.Fields inherited from class tools.jackson.databind.ser.BeanPropertyWriter
_accessor, _cfgSerializationType, _contextAnnotations, _declaredType, _dynamicSerializers, _includeInViews, _internalSettings, _member, _name, _nonTrivialBaseType, _nullSerializer, _serializer, _suppressableValue, _suppressNulls, _typeSerializer, _wrapperName, MARKER_FOR_EMPTYFields inherited from class tools.jackson.databind.introspect.ConcreteBeanPropertyBase
_aliases, _metadataFields inherited from interface tools.jackson.databind.BeanProperty
EMPTY_FORMAT, EMPTY_INCLUDE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUnwrappingBeanPropertyWriter(UnwrappingBeanPropertyWriter base, NameTransformer transformer, SerializedString name) UnwrappingBeanPropertyWriter(BeanPropertyWriter base, NameTransformer unwrapper) -
Method Summary
Modifier and TypeMethodDescriptionprotected void_depositSchemaProperty(ObjectNode propertiesNode, JsonNode schemaNode) protected ValueSerializer<Object>_findAndAddDynamic(PropertySerializerMap map, Class<?> type, SerializationContext provider) protected UnwrappingBeanPropertyWriter_new(NameTransformer transformer, SerializedString newName) Overridable factory method used by sub-classesvoidMethod called to assign value serializer for propertyvoiddepositSchemaProperty(JsonObjectFormatVisitor visitor, SerializationContext provider) Traversal method used for things like JSON Schema generation, or POJO introspection.booleanAccessor that will return true if this bean property has to support "unwrapping"; ability to replace POJO structural wrapping with optional name prefix and/or suffix (or in some cases, just removal of wrapper name).rename(NameTransformer transformer) voidserializeAsProperty(Object bean, JsonGenerator gen, SerializationContext prov) Method called to access property that this bean stands for, from within given bean, and to serialize it as a JSON Object field using appropriate serializer.Methods inherited from class tools.jackson.databind.ser.BeanPropertyWriter
_handleSelfReference, _new, assignNullSerializer, assignTypeSerializer, fixAccess, get, getAnnotation, getContextAnnotation, getFullName, getInternalSetting, getMember, getName, getSerializationType, getSerializedName, getSerializer, getType, getTypeSerializer, getViews, getWrapperName, hasNullSerializer, hasSerializer, removeInternalSetting, serializeAsElement, serializeAsOmittedElement, serializeAsOmittedProperty, setInternalSetting, setNonTrivialBaseType, toString, unwrappingWriter, willSuppressNulls, wouldConflictWithNameMethods 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, wait, wait, waitMethods inherited from interface tools.jackson.databind.util.FullyNamed
hasName
-
Field Details
-
_nameTransformer
Transformer used to add prefix and/or suffix for properties of unwrapped POJO.
-
-
Constructor Details
-
UnwrappingBeanPropertyWriter
-
UnwrappingBeanPropertyWriter
protected UnwrappingBeanPropertyWriter(UnwrappingBeanPropertyWriter base, NameTransformer transformer, SerializedString name)
-
-
Method Details
-
rename
- Overrides:
renamein classBeanPropertyWriter
-
_new
Overridable factory method used by sub-classes -
isUnwrapping
public boolean isUnwrapping()Description copied from class:BeanPropertyWriterAccessor that will return true if this bean property has to support "unwrapping"; ability to replace POJO structural wrapping with optional name prefix and/or suffix (or in some cases, just removal of wrapper name).Default implementation simply returns false.
- Overrides:
isUnwrappingin classBeanPropertyWriter
-
serializeAsProperty
public void serializeAsProperty(Object bean, JsonGenerator gen, SerializationContext prov) throws Exception Description copied from class:BeanPropertyWriterMethod called to access property that this bean stands for, from within given bean, and to serialize it as a JSON Object field using appropriate serializer.- Overrides:
serializeAsPropertyin classBeanPropertyWriter- Throws:
Exception
-
assignSerializer
Description copied from class:BeanPropertyWriterMethod called to assign value serializer for property- Overrides:
assignSerializerin classBeanPropertyWriter
-
depositSchemaProperty
Description copied from class:PropertyWriterTraversal method used for things like JSON Schema generation, or POJO introspection.- Specified by:
depositSchemaPropertyin interfaceBeanProperty- Overrides:
depositSchemaPropertyin classBeanPropertyWriter- Parameters:
visitor- Visitor to used as the callback handler
-
_depositSchemaProperty
- Overrides:
_depositSchemaPropertyin classBeanPropertyWriter
-
_findAndAddDynamic
protected ValueSerializer<Object> _findAndAddDynamic(PropertySerializerMap map, Class<?> type, SerializationContext provider) - Overrides:
_findAndAddDynamicin classBeanPropertyWriter
-