public class XMLParserConfiguration extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAXIMUM_NESTING_DEPTH
The default maximum nesting depth when parsing a XML document to JSON.
|
static XMLParserConfiguration |
KEEP_STRINGS
Original configuration of the XML Parser except that values are kept as strings.
|
static XMLParserConfiguration |
ORIGINAL
Original Configuration of the XML Parser.
|
static int |
UNDEFINED_MAXIMUM_NESTING_DEPTH
Used to indicate there's no defined limit to the maximum nesting depth when parsing a XML
document to JSON.
|
| Constructor and Description |
|---|
XMLParserConfiguration()
Default parser configuration.
|
| Modifier and Type | Method and Description |
|---|---|
protected XMLParserConfiguration |
clone()
Provides a new instance of the same configuration.
|
String |
getcDataTagName()
The name of the key in a JSON Object that indicates a CDATA section.
|
Set<String> |
getForceList()
When parsing the XML into JSON, specifies that tags that will be converted to arrays
in this configuration
Set<String> to parse the provided tags' values as arrays |
int |
getMaxNestingDepth()
The maximum nesting depth that the parser will descend before throwing an exception
when parsing the XML into JSON.
|
Map<String,XMLXsiTypeConverter<?>> |
getXsiTypeMap()
When parsing the XML into JSON, specifies that the values with attribute xsi:type
will be converted to target type defined to client in this configuration
Map<String, XMLXsiTypeConverter<?>> to parse values with attribute
xsi:type="integer" as integer, xsi:type="string" as string |
boolean |
isConvertNilAttributeToNull()
When parsing the XML into JSON, specifies if values with attribute xsi:nil="true"
should be kept as attribute(
false), or they should be converted to
null(true) |
boolean |
isKeepStrings()
When parsing the XML into JSON, specifies if values should be kept as strings (
true), or if
they should try to be guessed into JSON values (numeric, boolean, string) |
XMLParserConfiguration |
withcDataTagName(String newVal)
The name of the key in a JSON Object that indicates a CDATA section.
|
XMLParserConfiguration |
withConvertNilAttributeToNull(boolean newVal)
When parsing the XML into JSON, specifies if values with attribute xsi:nil="true"
should be kept as attribute(
false), or they should be converted to
null(true) |
XMLParserConfiguration |
withForceList(Set<String> forceList)
When parsing the XML into JSON, specifies that tags that will be converted to arrays
in this configuration
Set<String> to parse the provided tags' values as arrays |
XMLParserConfiguration |
withKeepStrings(boolean newVal)
When parsing the XML into JSON, specifies if values should be kept as strings (
true), or if
they should try to be guessed into JSON values (numeric, boolean, string) |
XMLParserConfiguration |
withMaxNestingDepth(int maxNestingDepth)
Defines the maximum nesting depth that the parser will descend before throwing an exception
when parsing the XML into JSON.
|
XMLParserConfiguration |
withXsiTypeMap(Map<String,XMLXsiTypeConverter<?>> xsiTypeMap)
When parsing the XML into JSON, specifies that the values with attribute xsi:type
will be converted to target type defined to client in this configuration
Map<String, XMLXsiTypeConverter<?>> to parse values with attribute
xsi:type="integer" as integer, xsi:type="string" as string |
public static final int UNDEFINED_MAXIMUM_NESTING_DEPTH
public static final int DEFAULT_MAXIMUM_NESTING_DEPTH
public static final XMLParserConfiguration ORIGINAL
public static final XMLParserConfiguration KEEP_STRINGS
public XMLParserConfiguration()
protected XMLParserConfiguration clone()
public boolean isKeepStrings()
true), or if
they should try to be guessed into JSON values (numeric, boolean, string)keepStrings configuration value.public XMLParserConfiguration withKeepStrings(boolean newVal)
true), or if
they should try to be guessed into JSON values (numeric, boolean, string)newVal - new value to use for the keepStrings configuration option.public String getcDataTagName()
null to indicate no CDATA
processing.cDataTagName configuration value.public XMLParserConfiguration withcDataTagName(String newVal)
null to indicate no CDATA
processing.newVal - new value to use for the cDataTagName configuration option.public boolean isConvertNilAttributeToNull()
false), or they should be converted to
null(true)convertNilAttributeToNull configuration value.public XMLParserConfiguration withConvertNilAttributeToNull(boolean newVal)
false), or they should be converted to
null(true)newVal - new value to use for the convertNilAttributeToNull configuration option.public Map<String,XMLXsiTypeConverter<?>> getXsiTypeMap()
Map<String, XMLXsiTypeConverter<?>> to parse values with attribute
xsi:type="integer" as integer, xsi:type="string" as stringxsiTypeMap unmodifiable configuration map.public XMLParserConfiguration withXsiTypeMap(Map<String,XMLXsiTypeConverter<?>> xsiTypeMap)
Map<String, XMLXsiTypeConverter<?>> to parse values with attribute
xsi:type="integer" as integer, xsi:type="string" as stringxsiTypeMap - new HashMap<String, XMLXsiTypeConverter<?>>() to parse values with attribute
xsi:type="integer" as integer, xsi:type="string" as stringpublic Set<String> getForceList()
Set<String> to parse the provided tags' values as arraysforceList unmodifiable configuration set.public XMLParserConfiguration withForceList(Set<String> forceList)
Set<String> to parse the provided tags' values as arraysforceList - new HashSet<String>() to parse the provided tags' values as arrayspublic int getMaxNestingDepth()
public XMLParserConfiguration withMaxNestingDepth(int maxNestingDepth)
maxNestingDepth - the maximum nesting depth allowed to the XML parser