com.fasterxml.jackson.dataformat.xml
Class XmlMapper

java.lang.Object
  extended by com.fasterxml.jackson.core.ObjectCodec
      extended by com.fasterxml.jackson.databind.ObjectMapper
          extended by com.fasterxml.jackson.dataformat.xml.XmlMapper
All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned, Serializable

public class XmlMapper
extends com.fasterxml.jackson.databind.ObjectMapper

Customized ObjectMapper that will read and write XML instead of JSON, using XML-backed JsonFactory implementation (XmlFactory).

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

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.ObjectMapper
com.fasterxml.jackson.databind.ObjectMapper.DefaultTypeResolverBuilder, com.fasterxml.jackson.databind.ObjectMapper.DefaultTyping
 
Field Summary
protected  JacksonXmlModule _xmlModule
           
protected static JacksonXmlModule DEFAULT_XML_MODULE
           
 
Fields inherited from class com.fasterxml.jackson.databind.ObjectMapper
_defaultPrettyPrinter, _deserializationConfig, _deserializationContext, _injectableValues, _jsonFactory, _mixInAnnotations, _rootDeserializers, _rootNames, _serializationConfig, _serializerFactory, _serializerProvider, _subtypeResolver, _typeFactory, DEFAULT_ANNOTATION_INTROSPECTOR, DEFAULT_BASE, DEFAULT_INTROSPECTOR, STD_VISIBILITY_CHECKER
 
Constructor Summary
XmlMapper()
           
XmlMapper(JacksonXmlModule module)
           
XmlMapper(XmlFactory xmlFactory)
           
XmlMapper(XmlFactory xmlFactory, JacksonXmlModule module)
           
 
Method Summary
protected  com.fasterxml.jackson.core.PrettyPrinter _defaultPrettyPrinter()
          XML indentation differs from JSON indentation, thereby need to change default pretty-printer
 com.fasterxml.jackson.databind.ObjectMapper configure(FromXmlParser.Feature f, boolean state)
           
 com.fasterxml.jackson.databind.ObjectMapper configure(ToXmlGenerator.Feature f, boolean state)
           
 XmlMapper copy()
           
 XmlFactory getFactory()
           
 XmlFactory getJsonFactory()
          Deprecated. Since 2.1, use getFactory() instead
protected  void setXMLTextElementName(String name)
          Method called by JacksonXmlModule to pass configuration information to XmlFactory, during registration.
 com.fasterxml.jackson.core.Version version()
           
 
Methods inherited from class com.fasterxml.jackson.databind.ObjectMapper
_checkInvalidCopy, _configAndWriteValue, _configAndWriteValue, _convert, _findRootDeserializer, _initForReading, _readMapAndClose, _readValue, _serializerProvider, _unwrapAndDeserialize, acceptJsonFormatVisitor, acceptJsonFormatVisitor, addHandler, addMixInAnnotations, canDeserialize, canSerialize, clearProblemHandlers, configure, configure, configure, configure, configure, constructType, convertValue, convertValue, convertValue, createArrayNode, createDeserializationContext, createObjectNode, disable, disable, disable, disable, disable, disableDefaultTyping, enable, enable, enable, enable, enable, enableDefaultTyping, enableDefaultTyping, enableDefaultTyping, enableDefaultTypingAsProperty, findMixInClassFor, generateJsonSchema, getDeserializationConfig, getDeserializationContext, getNodeFactory, getSerializationConfig, getSerializerFactory, getSerializerProvider, getSubtypeResolver, getTypeFactory, getVisibilityChecker, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, isEnabled, mixInCount, reader, reader, reader, reader, reader, reader, reader, reader, reader, reader, readerForUpdating, readerWithView, readTree, readTree, readTree, readTree, readTree, readTree, readTree, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValue, readValues, readValues, readValues, readValues, registerModule, registerSubtypes, registerSubtypes, setAnnotationIntrospector, setAnnotationIntrospectors, setBase64Variant, setDateFormat, setDefaultTyping, setFilters, setHandlerInstantiator, setInjectableValues, setLocale, setMixInAnnotations, setNodeFactory, setPropertyNamingStrategy, setSerializationInclusion, setSerializerFactory, setSerializerProvider, setSubtypeResolver, setTimeZone, setTypeFactory, setVisibility, setVisibilityChecker, treeAsTokens, treeToValue, valueToTree, writer, writer, writer, writer, writer, writer, writer, writer, writerWithDefaultPrettyPrinter, writerWithType, writerWithType, writerWithType, writerWithView, writeTree, writeValue, writeValue, writeValue, writeValue, writeValueAsBytes, writeValueAsString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_XML_MODULE

protected static final JacksonXmlModule DEFAULT_XML_MODULE

_xmlModule

protected final JacksonXmlModule _xmlModule
Constructor Detail

XmlMapper

public XmlMapper()

XmlMapper

public XmlMapper(XmlFactory xmlFactory)

XmlMapper

public XmlMapper(JacksonXmlModule module)

XmlMapper

public XmlMapper(XmlFactory xmlFactory,
                 JacksonXmlModule module)
Method Detail

copy

public XmlMapper copy()
Overrides:
copy in class com.fasterxml.jackson.databind.ObjectMapper

version

public com.fasterxml.jackson.core.Version version()
Specified by:
version in interface com.fasterxml.jackson.core.Versioned
Overrides:
version in class com.fasterxml.jackson.databind.ObjectMapper

setXMLTextElementName

protected void setXMLTextElementName(String name)
Method called by JacksonXmlModule to pass configuration information to XmlFactory, during registration.

Since:
2.1

getJsonFactory

@Deprecated
public XmlFactory getJsonFactory()
Deprecated. Since 2.1, use getFactory() instead

Overrides:
getJsonFactory in class com.fasterxml.jackson.databind.ObjectMapper

getFactory

public XmlFactory getFactory()
Overrides:
getFactory in class com.fasterxml.jackson.databind.ObjectMapper

configure

public com.fasterxml.jackson.databind.ObjectMapper configure(ToXmlGenerator.Feature f,
                                                             boolean state)

configure

public com.fasterxml.jackson.databind.ObjectMapper configure(FromXmlParser.Feature f,
                                                             boolean state)

_defaultPrettyPrinter

protected com.fasterxml.jackson.core.PrettyPrinter _defaultPrettyPrinter()
XML indentation differs from JSON indentation, thereby need to change default pretty-printer

Overrides:
_defaultPrettyPrinter in class com.fasterxml.jackson.databind.ObjectMapper


Copyright © 2012 FasterXML. All Rights Reserved.