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

public Class XmlMapper

extends ObjectMapper
Class Inheritance
Imports
java.io.Closeable, .IOException, javax.xml.stream.XMLStreamReader, .XMLStreamWriter, com.fasterxml.jackson.annotation.JsonTypeInfo, tools.jackson.core.*, tools.jackson.core.type.TypeReference, tools.jackson.databind.*, tools.jackson.databind.cfg.CoercionAction, .CoercionInputShape, .DeserializationContexts, .MapperBuilder, .MapperBuilderState, .SerializationContexts, tools.jackson.databind.jsontype.PolymorphicTypeValidator, .TypeResolverBuilder, tools.jackson.databind.ser.SerializationContextExt, tools.jackson.databind.type.LogicalType, tools.jackson.dataformat.xml.deser.FromXmlParser, .XmlDeserializationContexts, tools.jackson.dataformat.xml.ser.ToXmlGenerator, .XmlSerializationContexts, tools.jackson.dataformat.xml.util.DefaultXmlPrettyPrinter

Customized ObjectMapper that will read and write XML instead of JSON, using XML-backed tools.jackson.core.TokenStreamFactory implementation (XmlFactory), operation on STAX javax.xml.stream.XMLStreamReaders and javax.xml.stream.XMLStreamWriters.

Mapper itself overrides some aspects of functionality to try to handle data binding aspects as similar to JAXB as possible.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
XmlMapper.Builder

Builder implementation for constructing XmlMapper instances.

private static class
XmlMapper.SharedWrapper

Helper class to contain dynamically constructed "shared" instance of mapper, should one be needed via shared.

protected static class
XmlMapper.XmlBuilderState

Saved configuration entity to use with builder for XmlMapper instances.

Field Summary

Modifier and TypeField and Description
protected static final DefaultXmlPrettyPrinter
private static final long
Inherited from tools.jackson.databind.ObjectMapper:
_deserializationConfig_deserializationContexts_injectableValues_rootDeserializers_savedBuilderState_serializationConfig_serializationContexts_streamFactory_typeFactory

Constructor Summary

AccessConstructor and Description
public
public
public
XmlMapper(XmlFactory xmlFactory)

Method Summary

Modifier and TypeMethod and Description
public static XmlMapper.Builder
public static XmlMapper.Builder
builder(XmlFactory streamFactory)

public static XmlMapper.Builder
builderWithJackson2Defaults()

The builder returned uses default settings more closely matching the default configs used in Jackson 2.x versions.

public ToXmlGenerator
createGenerator(XMLStreamWriter w)

Overloaded variant that allows constructing ToXmlGenerator for given Stax XMLStreamWriter.

public FromXmlParser
createParser(XMLStreamReader r)

Overloaded variant that allows constructing FromXmlParser for given Stax XMLStreamReader.

protected Object
public <T> T
readValue(XMLStreamReader r, Class<T> valueType)

Method for reading a single XML value from given XML-specific input source; useful for incremental data-binding, combining traversal using basic Stax XMLStreamReader with data-binding by Jackson.

public <T> T
readValue(XMLStreamReader r, TypeReference<T> valueTypeRef)

Method for reading a single XML value from given XML-specific input source; useful for incremental data-binding, combining traversal using basic Stax XMLStreamReader with data-binding by Jackson.

public <T> T
readValue(XMLStreamReader r, JavaType valueType)

Method for reading a single XML value from given XML-specific input source; useful for incremental data-binding, combining traversal using basic Stax XMLStreamReader with data-binding by Jackson.

public XmlMapper.Builder
rebuild()

Overrides tools.jackson.databind.ObjectMapper.rebuild.

Method for creating a new MapperBuilder for constructing differently configured ObjectMapper instance, starting with current configuration including base settings and registered modules.

public static XmlMapper
shared()

Accessor method for getting globally shared "default" XmlMapper instance: one that has default configuration, no (custom) modules registered, no config overrides.

public XmlFactory
tokenStreamFactory()

Overrides tools.jackson.databind.ObjectMapper.tokenStreamFactory.

Method that can be used to get hold of TokenStreamFactory that this mapper uses if it needs to construct JsonParsers and/or JsonGenerators.

public Version
version()

Overrides tools.jackson.databind.ObjectMapper.version.

Implements tools.jackson.core.Versioned.version.

Method that will return version information stored in and read from jar that contains this class.

protected Object
public void
writeValue(XMLStreamWriter w, Object value)

Method for serializing given value using specific XMLStreamReader: useful when building large XML files by binding individual items, one at a time.

public static XmlMapper.Builder
Inherited from tools.jackson.databind.ObjectMapper:
_assertNotNull_configAndWriteValue_convert_deserializationContext_deserializationContext_deserializationContext_findRootDeserializer_initForReading_newReader_newReader_newWriter_newWriter_newWriter_readMapAndClose_readTreeAndClose_readValue_serializationContext_serializationContext_verifyNoTrailingTokens_verifySchemaType_writeCloseableValueacceptJsonFormatVisitoracceptJsonFormatVisitoracceptJsonFormatVisitorbooleanNodeclearCachesconstructTypeconstructTypeconvertValueconvertValueconvertValuecreateArrayNodecreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateGeneratorcreateNonBlockingByteArrayParsercreateNonBlockingByteBufferParsercreateObjectNodecreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParsercreateParserdeserializationConfiggetInjectableValuesgetNodeFactorygetTypeFactoryisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledisEnabledmissingNodenullNodereaderreaderreaderreaderreaderreaderreaderreaderreaderreaderForreaderForreaderForreaderForArrayOfreaderForListOfreaderForMapOfreaderForUpdatingreaderWithViewreadTreereadTreereadTreereadTreereadTreereadTreereadTreereadTreereadTreereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuereadValuesreadValuesreadValuesregisteredModulesserializationConfigstringNodetreeAsTokenstreeToValuetreeToValuetreeToValueupdateValuevalueToTreewriterwriterwriterwriterwriterwriterwriterwriterwriterwriterwriterForwriterForwriterForwriterWithDefaultPrettyPrinterwriterWithViewwriteTreewriteValuewriteValuewriteValuewriteValuewriteValuewriteValuewriteValueAsByteswriteValueAsStringwriteValueIntoBuffer