com.fasterxml.jackson.dataformat.xml.ser

## Class XmlSerializerProvider

- java.lang.Object
- - com.fasterxml.jackson.databind.DatabindContext
  - - com.fasterxml.jackson.databind.SerializerProvider
    - - com.fasterxml.jackson.databind.ser.DefaultSerializerProvider
      - - com.fasterxml.jackson.dataformat.xml.ser.XmlSerializerProvider

All Implemented Interfaces:
  Serializable

    public class XmlSerializerProvider
    extends com.fasterxml.jackson.databind.ser.DefaultSerializerProvider

We need to override some parts of `SerializerProvider` implementation to handle oddities of XML output, like "extra" root element.

See Also:
  Serialized Form

### Nested Class Summary

### Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.ser.DefaultSerializerProvider

`com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.Impl`

### Field Summary

Fields
`protected XmlRootNameLookup` `_rootNameLookup`
`protected static QName` `ROOT_NAME_FOR_NULL` If all we get to serialize is a null, there's no way to figure out expected root name; so let's just default to something like "<null>"...

### Fields inherited from class com.fasterxml.jackson.databind.ser.DefaultSerializerProvider

`_generator, _objectIdGenerators, _seenObjectIds`

### Fields inherited from class com.fasterxml.jackson.databind.SerializerProvider

`_attributes, _config, _dateFormat, _keySerializer, _knownSerializers, _nullKeySerializer, _nullValueSerializer, _serializationView, _serializerCache, _serializerFactory, _stdNullValueSerializer, _unknownTypeSerializer, CACHE_UNKNOWN_MAPPINGS, DEFAULT_NULL_KEY_SERIALIZER, DEFAULT_UNKNOWN_SERIALIZER`

### Constructor Summary

Constructors
`` `XmlSerializerProvider(XmlRootNameLookup rootNames)`
`protected` `XmlSerializerProvider(XmlSerializerProvider src)`
`` `XmlSerializerProvider(XmlSerializerProvider src, com.fasterxml.jackson.databind.SerializationConfig config, com.fasterxml.jackson.databind.ser.SerializerFactory f)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected ToXmlGenerator` `_asXmlGenerator(com.fasterxml.jackson.core.JsonGenerator gen)`
`protected void` `_initWithRootName(ToXmlGenerator xgen, QName rootName)`
`protected QName` `_rootNameFromConfig()`
`protected void` `_serializeXmlNull(com.fasterxml.jackson.core.JsonGenerator jgen)`
`protected void` `_startRootArray(ToXmlGenerator xgen, QName rootName)`
`protected IOException` `_wrapAsIOE(com.fasterxml.jackson.core.JsonGenerator g, Exception e)`
`com.fasterxml.jackson.databind.ser.DefaultSerializerProvider` `copy()`
`com.fasterxml.jackson.databind.ser.DefaultSerializerProvider` `createInstance(com.fasterxml.jackson.databind.SerializationConfig config, com.fasterxml.jackson.databind.ser.SerializerFactory jsf)`
`void` `serializeValue(com.fasterxml.jackson.core.JsonGenerator gen, Object value)`
`void` `serializeValue(com.fasterxml.jackson.core.JsonGenerator gen, Object value, com.fasterxml.jackson.databind.JavaType rootType, com.fasterxml.jackson.databind.JsonSerializer<Object> ser)`

### Methods inherited from class com.fasterxml.jackson.databind.ser.DefaultSerializerProvider

`_createObjectIdMap, _serializeNull, acceptJsonFormatVisitor, cachedSerializersCount, findObjectId, flushCachedSerializers, generateJsonSchema, getGenerator, hasSerializerFor, includeFilterInstance, includeFilterSuppressNulls, serializePolymorphic, serializerInstance, serializeValue`

### Methods inherited from class com.fasterxml.jackson.databind.SerializerProvider

`_createAndCacheUntypedSerializer, _createAndCacheUntypedSerializer, _createUntypedSerializer, _dateFormat, _findExplicitUntypedSerializer, _handleContextualResolvable, _handleResolvable, _reportIncompatibleRootType, canOverrideAccessModifiers, defaultSerializeDateKey, defaultSerializeDateKey, defaultSerializeDateValue, defaultSerializeDateValue, defaultSerializeField, defaultSerializeNull, defaultSerializeValue, findKeySerializer, findKeySerializer, findNullKeySerializer, findNullValueSerializer, findPrimaryPropertySerializer, findPrimaryPropertySerializer, findTypedValueSerializer, findTypedValueSerializer, findTypeSerializer, findValueSerializer, findValueSerializer, findValueSerializer, findValueSerializer, getActiveView, getAnnotationIntrospector, getAttribute, getConfig, getDefaultNullKeySerializer, getDefaultNullValueSerializer, getDefaultPropertyFormat, getDefaultPropertyInclusion, getFilterProvider, getLocale, getSerializationView, getTimeZone, getTypeFactory, getUnknownTypeSerializer, handlePrimaryContextualization, handleSecondaryContextualization, hasSerializationFeatures, invalidTypeIdException, isEnabled, isEnabled, isUnknownTypeSerializer, mappingException, mappingException, reportBadDefinition, reportBadDefinition, reportBadDefinition, reportBadPropertyDefinition, reportBadTypeDefinition, reportMappingProblem, reportMappingProblem, setAttribute, setDefaultKeySerializer, setNullKeySerializer, setNullValueSerializer`

### Methods inherited from class com.fasterxml.jackson.databind.DatabindContext

`_colonConcat, _desc, _format, _quotedString, _truncate, constructSpecializedType, constructType, converterInstance, objectIdGeneratorInstance, objectIdResolverInstance, reportBadDefinition, resolveSubType`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### ROOT_NAME_FOR_NULL

    protected static final QName ROOT_NAME_FOR_NULL

If all we get to serialize is a null, there's no way to figure out expected root name; so let's just default to something like "<null>"...

#### _rootNameLookup

    protected final XmlRootNameLookup _rootNameLookup

### Constructor Detail

#### XmlSerializerProvider

    public XmlSerializerProvider(XmlRootNameLookup rootNames)

#### XmlSerializerProvider

    public XmlSerializerProvider(XmlSerializerProvider src,
                                 com.fasterxml.jackson.databind.SerializationConfig config,
                                 com.fasterxml.jackson.databind.ser.SerializerFactory f)

#### XmlSerializerProvider

    protected XmlSerializerProvider(XmlSerializerProvider src)

Since:
  2.8.9

### Method Detail

#### copy

    public com.fasterxml.jackson.databind.ser.DefaultSerializerProvider copy()

Overrides:
  `copy` in class `com.fasterxml.jackson.databind.ser.DefaultSerializerProvider`

#### createInstance

    public com.fasterxml.jackson.databind.ser.DefaultSerializerProvider createInstance(com.fasterxml.jackson.databind.SerializationConfig config,
                                                                                       com.fasterxml.jackson.databind.ser.SerializerFactory jsf)

Specified by:
  `createInstance` in class `com.fasterxml.jackson.databind.ser.DefaultSerializerProvider`

#### serializeValue

    public void serializeValue(com.fasterxml.jackson.core.JsonGenerator gen,
                               Object value)
                        throws IOException

Overrides:
  `serializeValue` in class `com.fasterxml.jackson.databind.ser.DefaultSerializerProvider`
Throws:
  `IOException`

#### serializeValue

    public void serializeValue(com.fasterxml.jackson.core.JsonGenerator gen,
                               Object value,
                               com.fasterxml.jackson.databind.JavaType rootType,
                               com.fasterxml.jackson.databind.JsonSerializer<Object> ser)
                        throws IOException

Overrides:
  `serializeValue` in class `com.fasterxml.jackson.databind.ser.DefaultSerializerProvider`
Throws:
  `IOException`

#### _serializeXmlNull

    protected void _serializeXmlNull(com.fasterxml.jackson.core.JsonGenerator jgen)
                              throws IOException

Throws:
  `IOException`

#### _startRootArray

    protected void _startRootArray(ToXmlGenerator xgen,
                                   QName rootName)
                            throws IOException

Throws:
  `IOException`

#### _initWithRootName

    protected void _initWithRootName(ToXmlGenerator xgen,
                                     QName rootName)
                              throws IOException

Throws:
  `IOException`

#### _rootNameFromConfig

    protected QName _rootNameFromConfig()

#### _asXmlGenerator

    protected ToXmlGenerator _asXmlGenerator(com.fasterxml.jackson.core.JsonGenerator gen)
                                      throws com.fasterxml.jackson.databind.JsonMappingException

Throws:
  `com.fasterxml.jackson.databind.JsonMappingException`

#### _wrapAsIOE

    protected IOException _wrapAsIOE(com.fasterxml.jackson.core.JsonGenerator g,
                                     Exception e)