Class UnwrappingXmlBeanSerializer
java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<Object>
com.fasterxml.jackson.databind.ser.std.StdSerializer<Object>
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase
com.fasterxml.jackson.dataformat.xml.ser.XmlBeanSerializerBase
com.fasterxml.jackson.dataformat.xml.ser.UnwrappingXmlBeanSerializer
- All Implemented Interfaces:
JsonFormatVisitable,SchemaAware,ContextualSerializer,ResolvableSerializer,Serializable
Copy of
UnwrappingBeanSerializer required to extend
XmlBeanSerializerBase for XML-specific handling.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer
JsonSerializer.None -
Field Summary
Fields inherited from class com.fasterxml.jackson.dataformat.xml.ser.XmlBeanSerializerBase
KEY_XML_INFO -
Constructor Summary
ConstructorsConstructorDescriptionUnwrappingXmlBeanSerializer(UnwrappingXmlBeanSerializer src, ObjectIdWriter objectIdWriter) UnwrappingXmlBeanSerializer(UnwrappingXmlBeanSerializer src, ObjectIdWriter objectIdWriter, Object filterId) UnwrappingXmlBeanSerializer(XmlBeanSerializerBase src, NameTransformer transformer) Constructor used for creating unwrapping instance of a standardBeanSerializer -
Method Summary
Modifier and TypeMethodDescriptionbooleanAccessor for checking whether this serializer is an "unwrapping" serializer; this is necessary to know since it may also require caller to suppress writing of the leading property name.final voidserialize(Object bean, JsonGenerator jgen, SerializerProvider provider) Main serialization method that will delegate actual output to configuredBeanPropertyWriterinstances.toString()unwrappingSerializer(NameTransformer transformer) Method that will return serializer instance that produces "unwrapped" serialization, if applicable for type being serialized (which is the case for some serializers that produce JSON Objects as output).withFilterId(Object filterId) Mutant factory used for creating a new instance with different filter id (used withJsonFilterannotation)withObjectIdWriter(ObjectIdWriter objectIdWriter) Mutant factory used for creating a new instance with differentObjectIdWriter.Methods inherited from class com.fasterxml.jackson.dataformat.xml.ser.XmlBeanSerializerBase
serializeWithTypeMethods inherited from class com.fasterxml.jackson.databind.ser.std.BeanSerializerBase
acceptJsonFormatVisitor, createContextual, getSchema, properties, resolve, usesObjectIdMethods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
getSchema, handledType, wrapAndThrow, wrapAndThrowMethods inherited from class com.fasterxml.jackson.databind.JsonSerializer
getDelegatee, isEmpty, isEmpty, replaceDelegatee, withIgnoredProperties
-
Constructor Details
-
UnwrappingXmlBeanSerializer
Constructor used for creating unwrapping instance of a standardBeanSerializer -
UnwrappingXmlBeanSerializer
-
UnwrappingXmlBeanSerializer
public UnwrappingXmlBeanSerializer(UnwrappingXmlBeanSerializer src, ObjectIdWriter objectIdWriter, Object filterId)
-
-
Method Details
-
unwrappingSerializer
Description copied from class:JsonSerializerMethod that will return serializer instance that produces "unwrapped" serialization, if applicable for type being serialized (which is the case for some serializers that produce JSON Objects as output). If no unwrapped serializer can be constructed, will simply return serializer as-is.Default implementation just returns serializer as-is, indicating that no unwrapped variant exists
- Overrides:
unwrappingSerializerin classJsonSerializer<Object>- Parameters:
transformer- Name transformation to use to convert between names of unwrapper properties
-
isUnwrappingSerializer
public boolean isUnwrappingSerializer()Description copied from class:JsonSerializerAccessor for checking whether this serializer is an "unwrapping" serializer; this is necessary to know since it may also require caller to suppress writing of the leading property name.- Overrides:
isUnwrappingSerializerin classJsonSerializer<Object>
-
withObjectIdWriter
Description copied from class:BeanSerializerBaseMutant factory used for creating a new instance with differentObjectIdWriter.- Specified by:
withObjectIdWriterin classBeanSerializerBase
-
withFilterId
Description copied from class:BeanSerializerBaseMutant factory used for creating a new instance with different filter id (used withJsonFilterannotation)- Specified by:
withFilterIdin classBeanSerializerBase
-
serialize
public final void serialize(Object bean, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonGenerationException Main serialization method that will delegate actual output to configuredBeanPropertyWriterinstances.- Specified by:
serializein classBeanSerializerBase- Parameters:
bean- Value to serialize; can not be null.jgen- Generator used to output resulting Json contentprovider- Provider that can be used to get serializers for serializing Objects value contains, if any.- Throws:
IOExceptionJsonGenerationException
-
toString
-