Top Description Fields Constructors Methods
tools.jackson.dataformat.xml.ser

public Class XmlSerializationContext

extends SerializationContextExt
Class Inheritance
Imports
java.io.IOException, java.util.Map, javax.xml.namespace.QName, javax.xml.stream.XMLStreamException, tools.jackson.core.*, tools.jackson.core.exc.JacksonIOException, tools.jackson.databind.*, tools.jackson.databind.cfg.GeneratorSettings, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.node.ObjectNode, tools.jackson.databind.ser.SerializerFactory, .SerializationContextExt, .SerializerCache, tools.jackson.databind.util.TokenBuffer, tools.jackson.dataformat.xml.XmlWriteFeature, tools.jackson.dataformat.xml.util.StaxUtil, .TypeUtil, .XmlRootNameLookup

We need to override some parts of tools.jackson.databind.SerializationContext implementation to handle oddities of XML output, like "extra" root element.

Field Summary

Modifier and TypeField and Description
protected final XmlRootNameLookup
Inherited from tools.jackson.databind.ser.SerializationContextExt:
_objectIdGenerators_seenObjectIds

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected ToXmlGenerator
protected void
protected QName
protected void
protected void
protected boolean
protected void
protected JacksonException
public void
serializePolymorphic(JsonGenerator gen, Object value, JavaType rootType, ValueSerializer<Object> valueSer, TypeSerializer typeSer)

Overrides tools.jackson.databind.ser.SerializationContextExt.serializePolymorphic.

Alternate serialization call used for polymorphic types, when TypeSerializer is already known, but the actual serializer may or may not be.

public void
serializeValue(JsonGenerator gen, Object value)

Overrides tools.jackson.databind.ser.SerializationContextExt.serializeValue.

The method to be called by ObjectMapper and ObjectWriter for serializing given value, using serializers that this provider has access to (via caching and/or creating new serializers as need be).

public void
serializeValue(JsonGenerator gen, Object value, JavaType rootType)

Overrides tools.jackson.databind.ser.SerializationContextExt.serializeValue.

The method to be called by ObjectMapper and ObjectWriter for serializing given value (assumed to be of specified root type, instead of runtime type of value), using serializers that this provider has access to (via caching and/or creating new serializers as need be),

public void
serializeValue(JsonGenerator gen, Object value, JavaType rootType, ValueSerializer<Object> ser)

Overrides tools.jackson.databind.ser.SerializationContextExt.serializeValue.

The method to be called by ObjectWriter for serializing given value (assumed to be of specified root type, instead of runtime type of value), when it may know specific ValueSerializer to use.

Inherited from tools.jackson.databind.ser.SerializationContextExt:
_createObjectIdMap_serializeNullacceptJsonFormatVisitorfindObjectIdgetGeneratorincludeFilterInstanceincludeFilterSuppressNullsserializerInstancevalueToTree

Field Detail

_rootNameLookupback to summary
protected final XmlRootNameLookup _rootNameLookup

Constructor Detail

XmlSerializationContextback to summary
public XmlSerializationContext(TokenStreamFactory streamFactory, SerializationConfig config, GeneratorSettings genSettings, SerializerFactory f, SerializerCache cache, XmlRootNameLookup rootLookup)

Method Detail

_asXmlGeneratorback to summary
protected ToXmlGenerator _asXmlGenerator(JsonGenerator gen)
_initWithRootNameback to summary
protected void _initWithRootName(ToXmlGenerator xgen, QName rootName) throws JacksonException
_rootNameFromConfigback to summary
protected QName _rootNameFromConfig()
_serializeUnwrappedObjectNodeback to summary
protected void _serializeUnwrappedObjectNode(ToXmlGenerator xgen, Object value, ValueSerializer<Object> ser) throws JacksonException
_serializeXmlNullback to summary
protected void _serializeXmlNull(JsonGenerator gen) throws JacksonException
_shouldUnwrapObjectNodeback to summary
protected boolean _shouldUnwrapObjectNode(ToXmlGenerator xgen, Object value)
_startRootArrayback to summary
protected void _startRootArray(ToXmlGenerator xgen, QName rootName) throws JacksonException
_wrapAsJacksonEback to summary
protected JacksonException _wrapAsJacksonE(JsonGenerator g, Exception e)
serializePolymorphicback to summary
public void serializePolymorphic(JsonGenerator gen, Object value, JavaType rootType, ValueSerializer<Object> valueSer, TypeSerializer typeSer) throws JacksonException

Overrides tools.jackson.databind.ser.SerializationContextExt.serializePolymorphic.

Doc from tools.jackson.databind.ser.SerializationContextExt.serializePolymorphic.

Alternate serialization call used for polymorphic types, when TypeSerializer is already known, but the actual serializer may or may not be.

Annotations
@SuppressWarnings:resource
@Override
serializeValueback to summary
public void serializeValue(JsonGenerator gen, Object value) throws JacksonException

Overrides tools.jackson.databind.ser.SerializationContextExt.serializeValue.

Doc from tools.jackson.databind.ser.SerializationContextExt.serializeValue.

The method to be called by ObjectMapper and ObjectWriter for serializing given value, using serializers that this provider has access to (via caching and/or creating new serializers as need be).

Annotations
@SuppressWarnings:resource
@Override
serializeValueback to summary
public void serializeValue(JsonGenerator gen, Object value, JavaType rootType) throws JacksonException

Overrides tools.jackson.databind.ser.SerializationContextExt.serializeValue.

Doc from tools.jackson.databind.ser.SerializationContextExt.serializeValue.

The method to be called by ObjectMapper and ObjectWriter for serializing given value (assumed to be of specified root type, instead of runtime type of value), using serializers that this provider has access to (via caching and/or creating new serializers as need be),

Annotations
@Override
serializeValueback to summary
public void serializeValue(JsonGenerator gen, Object value, JavaType rootType, ValueSerializer<Object> ser) throws JacksonException

Overrides tools.jackson.databind.ser.SerializationContextExt.serializeValue.

Doc from tools.jackson.databind.ser.SerializationContextExt.serializeValue.

The method to be called by ObjectWriter for serializing given value (assumed to be of specified root type, instead of runtime type of value), when it may know specific ValueSerializer to use.

Annotations
@SuppressWarnings:resource
@Override