Class UnwrappingXmlBeanSerializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonSerializer<T>
-
- com.fasterxml.jackson.databind.ser.std.StdSerializer<java.lang.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,java.io.Serializable
public class UnwrappingXmlBeanSerializer extends XmlBeanSerializerBase
Copy ofUnwrappingBeanSerializerrequired to extendXmlBeanSerializerBasefor XML-specific handling.- See Also:
- Serialized Form
-
-
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
Constructors Constructor Description UnwrappingXmlBeanSerializer(UnwrappingXmlBeanSerializer src, ObjectIdWriter objectIdWriter)UnwrappingXmlBeanSerializer(UnwrappingXmlBeanSerializer src, ObjectIdWriter objectIdWriter, java.lang.Object filterId)UnwrappingXmlBeanSerializer(XmlBeanSerializerBase src, NameTransformer transformer)Constructor used for creating unwrapping instance of a standardBeanSerializer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisUnwrappingSerializer()Accessor 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.voidserialize(java.lang.Object bean, JsonGenerator jgen, SerializerProvider provider)Main serialization method that will delegate actual output to configuredBeanPropertyWriterinstances.java.lang.StringtoString()JsonSerializer<java.lang.Object>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).BeanSerializerBasewithFilterId(java.lang.Object filterId)Mutant factory used for creating a new instance with different filter id (used withJsonFilterannotation)BeanSerializerBasewithObjectIdWriter(ObjectIdWriter objectIdWriter)Mutant factory used for creating a new instance with differentObjectIdWriter.-
Methods inherited from class com.fasterxml.jackson.dataformat.xml.ser.XmlBeanSerializerBase
serializeWithType
-
Methods inherited from class com.fasterxml.jackson.databind.ser.std.BeanSerializerBase
acceptJsonFormatVisitor, createContextual, getSchema, properties, resolve, usesObjectId
-
Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
getSchema, handledType, wrapAndThrow, wrapAndThrow
-
Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer
getDelegatee, isEmpty, isEmpty, replaceDelegatee
-
-
-
-
Constructor Detail
-
UnwrappingXmlBeanSerializer
public UnwrappingXmlBeanSerializer(XmlBeanSerializerBase src, NameTransformer transformer)
Constructor used for creating unwrapping instance of a standardBeanSerializer
-
UnwrappingXmlBeanSerializer
public UnwrappingXmlBeanSerializer(UnwrappingXmlBeanSerializer src, ObjectIdWriter objectIdWriter)
-
UnwrappingXmlBeanSerializer
public UnwrappingXmlBeanSerializer(UnwrappingXmlBeanSerializer src, ObjectIdWriter objectIdWriter, java.lang.Object filterId)
-
-
Method Detail
-
unwrappingSerializer
public JsonSerializer<java.lang.Object> unwrappingSerializer(NameTransformer transformer)
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<java.lang.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<java.lang.Object>
-
withObjectIdWriter
public BeanSerializerBase withObjectIdWriter(ObjectIdWriter objectIdWriter)
Description copied from class:BeanSerializerBaseMutant factory used for creating a new instance with differentObjectIdWriter.- Specified by:
withObjectIdWriterin classBeanSerializerBase
-
withFilterId
public BeanSerializerBase withFilterId(java.lang.Object filterId)
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(java.lang.Object bean, JsonGenerator jgen, SerializerProvider provider) throws java.io.IOException, JsonGenerationExceptionMain 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:
java.io.IOExceptionJsonGenerationException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-