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

public final Enum XmlReadFeature

extends Enum<XmlReadFeature>
implements FormatFeature
Class Inheritance
All Implemented Interfaces
tools.jackson.core.FormatFeature, tools.jackson.core.util.JacksonFeature
Imports
javax.xml.XMLConstants, tools.jackson.core.FormatFeature, .JsonToken

Enumeration that defines all togglable features for XML parsers.

Note

in Jackson 2.x this was named FromXmlParser.Feature.

Field Summary

Modifier and TypeField and Description
private final boolean
private final int
public static final XmlReadFeature
AUTO_DETECT_XSI_TYPE

Feature that enables automatic conversion of incoming "xsi:type" (where "type" is the local name and "xsi" prefix is bound to URI XMLConstants#W3C_XML_SCHEMA_INSTANCE_NS_URI), into Jackson simple Property Name of "xsi:type".

public static final XmlReadFeature
EMPTY_ELEMENT_AS_NULL

Feature that indicates whether empty XML elements (both empty tags like <tag /> and <tag></tag> (with no intervening cdata) are exposed as JsonToken#VALUE_NULL) or not.

public static final XmlReadFeature
PROCESS_XSI_NIL

Feature that indicates whether XML Schema Instance attribute xsi:nil will be processed automatically -- to indicate null values -- or not.

Constructor Summary

AccessConstructor and Description
private
XmlReadFeature(boolean defaultState)

Method Summary

Modifier and TypeMethod and Description
public static int
collectDefaults()

Method that calculates bit set (flags) of all features that are enabled by default.

public boolean
enabledByDefault()

Implements tools.jackson.core.util.JacksonFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

public boolean
enabledIn(int flags)

Implements tools.jackson.core.util.JacksonFeature.enabledIn.

Convenience method for checking whether feature is enabled in given bitmask.

public int
getMask()

Implements tools.jackson.core.util.JacksonFeature.getMask.

Returns bit mask for this feature instance; must be a single bit, that is of form 1 << N.

public static XmlReadFeature
public static XmlReadFeature[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

_defaultStateback to summary
private final boolean _defaultState
_maskback to summary
private final int _mask
AUTO_DETECT_XSI_TYPEback to summary
public static final XmlReadFeature AUTO_DETECT_XSI_TYPE

Feature that enables automatic conversion of incoming "xsi:type" (where "type" is the local name and "xsi" prefix is bound to URI XMLConstants#W3C_XML_SCHEMA_INSTANCE_NS_URI), into Jackson simple Property Name of "xsi:type". This is usually needed to read content written using matching ToXmlGenerator.Feature#AUTO_DETECT_XSI_TYPE feature, usually used for Polymorphic handling where it is difficult to specify proper XML Namespace for type identifier.

Default setting is true (was false in Jackson 2.x).

EMPTY_ELEMENT_AS_NULLback to summary
public static final XmlReadFeature EMPTY_ELEMENT_AS_NULL

Feature that indicates whether empty XML elements (both empty tags like <tag /> and <tag></tag> (with no intervening cdata) are exposed as JsonToken#VALUE_NULL) or not. If they are not returned as `null` tokens, they will be returned as JsonToken#VALUE_STRING tokens with textual value of "" (empty String).

Note

in Jackson 2.x, only "true" empty tags were affected, not split ones. With 3.x both cases handled uniformly.

Default setting is false.

PROCESS_XSI_NILback to summary
public static final XmlReadFeature PROCESS_XSI_NIL

Feature that indicates whether XML Schema Instance attribute xsi:nil will be processed automatically -- to indicate null values -- or not. If enabled, xsi:nil attribute on any XML element will mark such elements as "null values" and any other attributes or child elements they might have to be ignored. If disabled this attribute will be exposed like any other attribute.

Default setting is true.

Constructor Detail

XmlReadFeatureback to summary
private XmlReadFeature(boolean defaultState)

Method Detail

collectDefaultsback to summary
public static int collectDefaults()

Method that calculates bit set (flags) of all features that are enabled by default.

enabledByDefaultback to summary
public boolean enabledByDefault()

Implements tools.jackson.core.util.JacksonFeature.enabledByDefault.

Doc from tools.jackson.core.util.JacksonFeature.enabledByDefault.

Accessor for checking whether this feature is enabled by default.

Annotations
@Override
enabledInback to summary
public boolean enabledIn(int flags)

Implements tools.jackson.core.util.JacksonFeature.enabledIn.

Doc from tools.jackson.core.util.JacksonFeature.enabledIn.

Convenience method for checking whether feature is enabled in given bitmask.

Annotations
@Override
getMaskback to summary
public int getMask()

Implements tools.jackson.core.util.JacksonFeature.getMask.

Doc from tools.jackson.core.util.JacksonFeature.getMask.

Returns bit mask for this feature instance; must be a single bit, that is of form 1 << N.

Annotations
@Override
valueOfback to summary
public static XmlReadFeature valueOf(String name)
valuesback to summary
public static XmlReadFeature[] values()