Class XmlSerializationContext

java.lang.Object
tools.jackson.databind.DatabindContext
tools.jackson.databind.SerializationContext
tools.jackson.databind.ser.SerializationContextExt
tools.jackson.dataformat.xml.ser.XmlSerializationContext
All Implemented Interfaces:
tools.jackson.core.ObjectWriteContext

public class XmlSerializationContext extends tools.jackson.databind.ser.SerializationContextExt
We need to override some parts of SerializationContext implementation to handle oddities of XML output, like "extra" root element.
  • Nested Class Summary

    Nested classes/interfaces inherited from class tools.jackson.databind.ser.SerializationContextExt

    tools.jackson.databind.ser.SerializationContextExt.Impl

    Nested classes/interfaces inherited from interface tools.jackson.core.ObjectWriteContext

    tools.jackson.core.ObjectWriteContext.Base
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final XmlRootNameLookup
     

    Fields inherited from class tools.jackson.databind.ser.SerializationContextExt

    _objectIdGenerators, _seenObjectIds

    Fields inherited from class tools.jackson.databind.SerializationContext

    _activeView, _attributes, _classIntrospector, _config, _dateFormat, _generator, _generatorConfig, _knownSerializers, _nullValueSerializer, _serializerCache, _serializerFactory, _stdNullValueSerializer, _streamFactory, _writeCapabilities, DEFAULT_UNKNOWN_SERIALIZER
  • Constructor Summary

    Constructors
    Constructor
    Description
    XmlSerializationContext(tools.jackson.core.TokenStreamFactory streamFactory, tools.jackson.databind.SerializationConfig config, tools.jackson.databind.cfg.GeneratorSettings genSettings, tools.jackson.databind.ser.SerializerFactory f, tools.jackson.databind.ser.SerializerCache cache, XmlRootNameLookup rootLookup)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected ToXmlGenerator
    _asXmlGenerator(tools.jackson.core.JsonGenerator gen)
     
    protected void
     
    protected QName
     
    protected void
    _serializeUnwrappedObjectNode(ToXmlGenerator xgen, Object value, tools.jackson.databind.ValueSerializer<Object> ser)
     
    protected void
    _serializeXmlNull(tools.jackson.core.JsonGenerator gen)
     
    protected boolean
     
    protected void
     
    protected tools.jackson.core.JacksonException
    _wrapAsJacksonE(tools.jackson.core.JsonGenerator g, Exception e)
     
    void
    serializePolymorphic(tools.jackson.core.JsonGenerator gen, Object value, tools.jackson.databind.JavaType rootType, tools.jackson.databind.ValueSerializer<Object> valueSer, tools.jackson.databind.jsontype.TypeSerializer typeSer)
     
    void
    serializeValue(tools.jackson.core.JsonGenerator gen, Object value)
     
    void
    serializeValue(tools.jackson.core.JsonGenerator gen, Object value, tools.jackson.databind.JavaType rootType)
     
    void
    serializeValue(tools.jackson.core.JsonGenerator gen, Object value, tools.jackson.databind.JavaType rootType, tools.jackson.databind.ValueSerializer<Object> ser)
     

    Methods inherited from class tools.jackson.databind.ser.SerializationContextExt

    _createObjectIdMap, _serializeNull, acceptJsonFormatVisitor, findObjectId, getGenerator, includeFilterInstance, includeFilterSuppressNulls, serializerInstance, valueToTree

    Methods inherited from class tools.jackson.databind.SerializationContext

    _assignGenerator, _createAndCachePropertySerializer, _createAndCachePropertySerializer, _createAndCacheUntypedSerializer, _createAndCacheUntypedSerializer, _dateFormat, _handleResolvable, _mappingProblem, _reportIncompatibleRootType, bufferForValueConversion, canOverrideAccessModifiers, classIntrospector, constructSpecializedType, createArrayNode, createObjectNode, defaultSerializeDateKey, defaultSerializeDateKey, defaultSerializeDateValue, defaultSerializeDateValue, defaultSerializeNullValue, defaultSerializeProperty, findContentValueSerializer, findContentValueSerializer, findKeySerializer, findKeySerializer, findNullKeySerializer, findNullValueSerializer, findPrimaryPropertySerializer, findPrimaryPropertySerializer, findPropertyTypeSerializer, findRootName, findRootName, findRootValueSerializer, findRootValueSerializer, findTypedValueSerializer, findTypedValueSerializer, findTypeSerializer, findTypeSerializer, findValueSerializer, findValueSerializer, getActiveView, getAnnotationIntrospector, getAttribute, getCharacterEscapes, getConfig, getDatatypeFeatures, getDefaultNullValueSerializer, getDefaultPropertyFormat, getDefaultPropertyInclusion, getFilterProvider, getFormatWriteFeatures, getLocale, getPrettyPrinter, getRootValueSeparator, getSchema, getStreamWriteFeatures, getTimeZone, getTypeFactory, getUnknownTypeSerializer, handlePrimaryContextualization, handleRootContextualization, handleSecondaryContextualization, hasPrettyPrinter, hasSerializationFeatures, introspectBeanDescription, invalidTypeIdException, isEnabled, isEnabled, isEnabled, isEnabled, isUnknownTypeSerializer, reportBadDefinition, reportBadDefinition, reportBadDefinition, reportBadPropertyDefinition, reportBadTypeDefinition, reportMappingProblem, reportMappingProblem, setAttribute, tokenStreamFactory, writeTree, writeValue

    Methods inherited from class tools.jackson.databind.DatabindContext

    _colonConcat, _desc, _format, _quotedString, _throwNotASubtype, _throwSubtypeClassNotAllowed, _throwSubtypeNameNotAllowed, _truncate, constructType, converterInstance, introspectBeanDescription, introspectClassAnnotations, introspectClassAnnotations, introspectDirectClassAnnotations, isAnnotationProcessingEnabled, lazyIntrospectBeanDescription, objectIdGeneratorInstance, objectIdResolverInstance, reportBadDefinition, reportBadTypeDefinition, resolveAndValidateSubType, resolveSubType

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface tools.jackson.core.ObjectWriteContext

    createGenerator, createGenerator, createGenerator
  • Field Details

  • Constructor Details

    • XmlSerializationContext

      public XmlSerializationContext(tools.jackson.core.TokenStreamFactory streamFactory, tools.jackson.databind.SerializationConfig config, tools.jackson.databind.cfg.GeneratorSettings genSettings, tools.jackson.databind.ser.SerializerFactory f, tools.jackson.databind.ser.SerializerCache cache, XmlRootNameLookup rootLookup)
  • Method Details

    • serializeValue

      public void serializeValue(tools.jackson.core.JsonGenerator gen, Object value) throws tools.jackson.core.JacksonException
      Overrides:
      serializeValue in class tools.jackson.databind.ser.SerializationContextExt
      Throws:
      tools.jackson.core.JacksonException
    • serializeValue

      public void serializeValue(tools.jackson.core.JsonGenerator gen, Object value, tools.jackson.databind.JavaType rootType) throws tools.jackson.core.JacksonException
      Overrides:
      serializeValue in class tools.jackson.databind.ser.SerializationContextExt
      Throws:
      tools.jackson.core.JacksonException
    • serializeValue

      public void serializeValue(tools.jackson.core.JsonGenerator gen, Object value, tools.jackson.databind.JavaType rootType, tools.jackson.databind.ValueSerializer<Object> ser) throws tools.jackson.core.JacksonException
      Overrides:
      serializeValue in class tools.jackson.databind.ser.SerializationContextExt
      Throws:
      tools.jackson.core.JacksonException
    • serializePolymorphic

      public void serializePolymorphic(tools.jackson.core.JsonGenerator gen, Object value, tools.jackson.databind.JavaType rootType, tools.jackson.databind.ValueSerializer<Object> valueSer, tools.jackson.databind.jsontype.TypeSerializer typeSer) throws tools.jackson.core.JacksonException
      Overrides:
      serializePolymorphic in class tools.jackson.databind.ser.SerializationContextExt
      Throws:
      tools.jackson.core.JacksonException
    • _serializeXmlNull

      protected void _serializeXmlNull(tools.jackson.core.JsonGenerator gen) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _startRootArray

      protected void _startRootArray(ToXmlGenerator xgen, QName rootName) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _initWithRootName

      protected void _initWithRootName(ToXmlGenerator xgen, QName rootName) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _rootNameFromConfig

      protected QName _rootNameFromConfig()
    • _shouldUnwrapObjectNode

      protected boolean _shouldUnwrapObjectNode(ToXmlGenerator xgen, Object value)
    • _serializeUnwrappedObjectNode

      protected void _serializeUnwrappedObjectNode(ToXmlGenerator xgen, Object value, tools.jackson.databind.ValueSerializer<Object> ser) throws tools.jackson.core.JacksonException
      Throws:
      tools.jackson.core.JacksonException
    • _asXmlGenerator

      protected ToXmlGenerator _asXmlGenerator(tools.jackson.core.JsonGenerator gen)
    • _wrapAsJacksonE

      protected tools.jackson.core.JacksonException _wrapAsJacksonE(tools.jackson.core.JsonGenerator g, Exception e)