Module tools.jackson.dataformat.xml
Package tools.jackson.dataformat.xml.ser
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.ImplNested classes/interfaces inherited from interface tools.jackson.core.ObjectWriteContext
tools.jackson.core.ObjectWriteContext.Base -
Field Summary
FieldsFields inherited from class tools.jackson.databind.ser.SerializationContextExt
_objectIdGenerators, _seenObjectIdsFields 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
ConstructorsConstructorDescriptionXmlSerializationContext(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 TypeMethodDescriptionprotected ToXmlGenerator_asXmlGenerator(tools.jackson.core.JsonGenerator gen) protected void_initWithRootName(ToXmlGenerator xgen, QName rootName) protected QNameprotected void_serializeUnwrappedObjectNode(ToXmlGenerator xgen, Object value, tools.jackson.databind.ValueSerializer<Object> ser) protected void_serializeXmlNull(tools.jackson.core.JsonGenerator gen) protected boolean_shouldUnwrapObjectNode(ToXmlGenerator xgen, Object value) protected void_startRootArray(ToXmlGenerator xgen, QName rootName) protected tools.jackson.core.JacksonException_wrapAsJacksonE(tools.jackson.core.JsonGenerator g, Exception e) voidserializePolymorphic(tools.jackson.core.JsonGenerator gen, Object value, tools.jackson.databind.JavaType rootType, tools.jackson.databind.ValueSerializer<Object> valueSer, tools.jackson.databind.jsontype.TypeSerializer typeSer) voidserializeValue(tools.jackson.core.JsonGenerator gen, Object value) voidserializeValue(tools.jackson.core.JsonGenerator gen, Object value, tools.jackson.databind.JavaType rootType) voidserializeValue(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, valueToTreeMethods 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, writeValueMethods 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, resolveSubTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface tools.jackson.core.ObjectWriteContext
createGenerator, createGenerator, createGenerator
-
Field Details
-
_rootNameLookup
-
-
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:
serializeValuein classtools.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:
serializeValuein classtools.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:
serializeValuein classtools.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:
serializePolymorphicin classtools.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
-
_shouldUnwrapObjectNode
-
_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
-
_wrapAsJacksonE
protected tools.jackson.core.JacksonException _wrapAsJacksonE(tools.jackson.core.JsonGenerator g, Exception e)
-