public class XMLParserConfiguration extends ParserConfiguration
| Modifier and Type | Field and Description |
|---|---|
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.
|
DEFAULT_MAXIMUM_NESTING_DEPTH, keepStrings, maxNestingDepth, UNDEFINED_MAXIMUM_NESTING_DEPTH| 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 |
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) |
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 |
getMaxNestingDepth, isKeepStringspublic static final XMLParserConfiguration ORIGINAL
public static final XMLParserConfiguration KEEP_STRINGS
public XMLParserConfiguration()
protected XMLParserConfiguration clone()
clone in class ParserConfigurationpublic XMLParserConfiguration withKeepStrings(boolean newVal)
true), or if
they should try to be guessed into JSON values (numeric, boolean, string)withKeepStrings in class ParserConfigurationnewVal - 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 XMLParserConfiguration withMaxNestingDepth(int maxNestingDepth)
withMaxNestingDepth in class ParserConfigurationmaxNestingDepth - the maximum nesting depth allowed to the XML parser