public class JacksonXmlModule extends com.fasterxml.jackson.databind.module.SimpleModule implements Serializable
XmlMapper
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.
Modifier and Type | Field and Description |
---|---|
protected boolean |
_cfgDefaultUseWrapper
Determination of whether indexed properties (arrays, Lists) that are not explicitly
annotated (with
JacksonXmlElementWrapper
or equivalent) should default to using implicit wrapper (with same name as property) or not. |
protected String |
_cfgNameForTextElement
Name used for pseudo-property used for returning XML Text value (which does
not have actual element name to use).
|
Constructor and Description |
---|
JacksonXmlModule() |
Modifier and Type | Method and Description |
---|---|
protected com.fasterxml.jackson.databind.AnnotationIntrospector |
_constructIntrospector() |
void |
setDefaultUseWrapper(boolean state)
Method that can be used to define whether
AnnotationIntrospector
we register will use wrapper for indexed (List, array) properties or not,
if there are no explicit annotations. |
void |
setupModule(com.fasterxml.jackson.databind.Module.SetupContext context) |
void |
setXMLTextElementName(String name)
Method that can be used to define alternate "virtual name" to use
for XML CDATA segments; that is, text values.
|
_checkNotNull, addAbstractTypeMapping, addDeserializer, addKeyDeserializer, addKeySerializer, addSerializer, addSerializer, addValueInstantiator, getModuleName, getTypeId, registerSubtypes, registerSubtypes, registerSubtypes, setAbstractTypes, setDeserializerModifier, setDeserializers, setKeyDeserializers, setKeySerializers, setMixInAnnotation, setNamingStrategy, setSerializerModifier, setSerializers, setValueInstantiators, version
protected boolean _cfgDefaultUseWrapper
JacksonXmlElementWrapper
or equivalent) should default to using implicit wrapper (with same name as property) or not.
If enabled, wrapping is used by default; if false, it is not.
Note that JAXB annotation introspector always assumes "do not wrap by default". Jackson annotations have different default due to backwards compatibility.
protected String _cfgNameForTextElement
public void setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)
setupModule
in class com.fasterxml.jackson.databind.module.SimpleModule
public void setDefaultUseWrapper(boolean state)
AnnotationIntrospector
we register will use wrapper for indexed (List, array) properties or not,
if there are no explicit annotations.
See JacksonXmlElementWrapper
for details.
Note that method MUST be called before registering the module; otherwise change will not have any effect.
state
- Whether to enable or disable "use wrapper for non-annotated List properties"public void setXMLTextElementName(String name)
Note that method MUST be called before registering the module; otherwise change will not have any effect.
name
- Virtual name to use when exposing XML character data sectionsprotected com.fasterxml.jackson.databind.AnnotationIntrospector _constructIntrospector()
Copyright © 2022 FasterXML. All rights reserved.