Class JacksonXmlModule
- java.lang.Object
-
- com.fasterxml.jackson.databind.Module
-
- com.fasterxml.jackson.databind.module.SimpleModule
-
- com.fasterxml.jackson.dataformat.xml.JacksonXmlModule
-
- All Implemented Interfaces:
Versioned
,java.io.Serializable
public class JacksonXmlModule extends SimpleModule implements java.io.Serializable
Module that implements most functionality needed to support producing and consuming XML instead of JSON, used byXmlMapper
for registering handlers for XML-specific processing.NOTE: please do NOT register this directly on
XmlMapper
: mapper registers an instance (either one explicitly given in constructor, or, if none, one it configures) and attempts to re-register is unlikely to work as you'd expect.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.Module
Module.SetupContext
-
-
Constructor Summary
Constructors Constructor Description JacksonXmlModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setDefaultUseWrapper(boolean state)
Method that can be used to define whetherAnnotationIntrospector
we register will use wrapper for indexed (List, array) properties or not, if there are no explicit annotations.void
setupModule(Module.SetupContext context)
Standard implementation handles registration of all configured customizations: it is important that sub-classes call this implementation (usually before additional custom logic) if they choose to override it; otherwise customizations will not be registered.void
setXMLTextElementName(java.lang.String name)
Method that can be used to define alternate "virtual name" to use for XML CDATA segments; that is, text values.-
Methods inherited from class com.fasterxml.jackson.databind.module.SimpleModule
addAbstractTypeMapping, addDeserializer, addKeyDeserializer, addKeySerializer, addSerializer, addSerializer, addValueInstantiator, getModuleName, getTypeId, registerSubtypes, registerSubtypes, registerSubtypes, setAbstractTypes, setDeserializerModifier, setDeserializers, setKeyDeserializers, setKeySerializers, setMixInAnnotation, setSerializerModifier, setSerializers, setValueInstantiators, version
-
Methods inherited from class com.fasterxml.jackson.databind.Module
getDependencies
-
-
-
-
Method Detail
-
setupModule
public void setupModule(Module.SetupContext context)
Description copied from class:SimpleModule
Standard implementation handles registration of all configured customizations: it is important that sub-classes call this implementation (usually before additional custom logic) if they choose to override it; otherwise customizations will not be registered.- Overrides:
setupModule
in classSimpleModule
-
setDefaultUseWrapper
public void setDefaultUseWrapper(boolean state)
Method that can be used to define whetherAnnotationIntrospector
we register will use wrapper for indexed (List, array) properties or not, if there are no explicit annotations. SeeJacksonXmlElementWrapper
for details.Note that method MUST be called before registering the module; otherwise change will not have any effect.
- Parameters:
state
- Whether to enable or disable "use wrapper for non-annotated List properties"- Since:
- 2.1
-
setXMLTextElementName
public void setXMLTextElementName(java.lang.String name)
Method that can be used to define alternate "virtual name" to use for XML CDATA segments; that is, text values. Default name is empty String (""); but some frameworks use other names: JAXB, for example, uses "value".Note that method MUST be called before registering the module; otherwise change will not have any effect.
- Parameters:
name
- Virtual name to use when exposing XML character data sections- Since:
- 2.1
-
-