public class XMLParserConfiguration extends Object
| 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.
|
| Constructor and Description |
|---|
XMLParserConfiguration()
Default parser configuration.
|
XMLParserConfiguration(boolean keepStrings)
Deprecated.
This constructor has been deprecated in favor of using the new builder
pattern for the configuration.
This constructor may be removed in a future release.
|
XMLParserConfiguration(boolean keepStrings,
String cDataTagName)
Deprecated.
This constructor has been deprecated in favor of using the new builder
pattern for the configuration.
This constructor may be removed in a future release.
|
XMLParserConfiguration(boolean keepStrings,
String cDataTagName,
boolean convertNilAttributeToNull)
Deprecated.
This constructor has been deprecated in favor of using the new builder
pattern for the configuration.
This constructor may be removed or marked private in a future release.
|
XMLParserConfiguration(String cDataTagName)
Deprecated.
This constructor has been deprecated in favor of using the new builder
pattern for the configuration.
This constructor may be removed in a future release.
|
| 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.
|
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 |
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 |
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 XMLParserConfiguration ORIGINAL
public static final XMLParserConfiguration KEEP_STRINGS
public XMLParserConfiguration()
@Deprecated public XMLParserConfiguration(boolean keepStrings)
keepStrings - true to parse all values as string.
false to try and convert XML string values into a JSON value.@Deprecated public XMLParserConfiguration(String cDataTagName)
null to
disable CDATA processingcDataTagNamenull - to disable CDATA processing. Any other value
to use that value as the JSONObject key name to process as CDATA.@Deprecated public XMLParserConfiguration(boolean keepStrings, String cDataTagName)
keepStrings - true to parse all values as string.
false to try and convert XML string values into a JSON value.cDataTagNamenull - to disable CDATA processing. Any other value
to use that value as the JSONObject key name to process as CDATA.@Deprecated public XMLParserConfiguration(boolean keepStrings, String cDataTagName, boolean convertNilAttributeToNull)
keepStrings - true to parse all values as string.
false to try and convert XML string values into a JSON value.cDataTagName - null to disable CDATA processing. Any other value
to use that value as the JSONObject key name to process as CDATA.convertNilAttributeToNull - true to parse values with attribute xsi:nil="true" as null.
false to parse values with attribute xsi:nil="true" as {"xsi:nil":true}.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 string