Interface JsonXMLConfig
- All Known Implementing Classes:
JsonXMLConfigImpl
Json XML factory configuration interface.
A JsonXMLConfig instance can be used to configure either
of JsonXMLInputFactory or JsonXMLOutputFactory.
Default values are defined by static DEFAULT instance.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionFormat output ignoring scientific numberscharNamespace prefix separator.JSON documents may have have multiple root properties.booleanTrigger arrays automatically?booleanConvert element text to number/boolean/null primitives automatically?booleanWhether to use theJsonXMLStreamConstants.MULTIPLE_PI_TARGETprocessing instruction to indicate an array start.booleanWhether to write namespace declarations.booleanPreserves the namespace declarations in the JSON output in XML to JSON transformations.booleanFormat output for better readability?booleanBuilds valid XML NCNames when building XML element names in XML to JSON transformations.booleanbooleanRepair namespaces when writinginvalid input: '<'/+>booleanUsed in XML->JSON conversion.
-
Field Details
-
DEFAULT
Default configuration:
- autoArray -
false - autoPrimitive -
false - multiplePI -
true - namespaceDeclarations -
true - namespaceSeparator -
':' - prettyPrint -
false - virtualRoot -
null
- autoArray -
-
-
Method Details
-
isAutoArray
boolean isAutoArray()Trigger arrays automatically?
- Returns:
- auto array flag
- See Also:
-
isAutoPrimitive
boolean isAutoPrimitive()Convert element text to number/boolean/null primitives automatically?
- Returns:
- auto primitive flag
- See Also:
-
isMultiplePI
boolean isMultiplePI()Whether to use the
IfJsonXMLStreamConstants.MULTIPLE_PI_TARGETprocessing instruction to indicate an array start. Iftrue, a PI is used to inform the writer to begin an array, passing the name of following multiple elements as data. The writer will close arrays automatically.true, this reader will insert a PI with the field name as PI data.Note that the element given in the PI may occur zero times, indicating an "empty array".
- Returns:
- multiple PI flag
- See Also:
-
isNamespaceDeclarations
boolean isNamespaceDeclarations()Whether to write namespace declarations.
- Returns:
- namespace declarations flag
- See Also:
-
getNamespaceSeparator
char getNamespaceSeparator()Namespace prefix separator.
- Returns:
- namespace separator
- See Also:
-
isPrettyPrint
boolean isPrettyPrint()Format output for better readability?
- Returns:
- pretty print flag
- See Also:
-
getVirtualRoot
QName getVirtualRoot()JSON documents may have have multiple root properties. However, XML requires a single root element. This property specifies the root as a "virtual" element, which will be removed from the stream when writing and added to the stream when reading.
- Returns:
- virtual root
- See Also:
-
isRepairingNamespaces
boolean isRepairingNamespaces()Repair namespaces when writinginvalid input: '<'/+>
- Returns:
- namespace-repairing flag
- See Also:
-
getCustomRegex
String getCustomRegex()Format output ignoring scientific numbers
- Returns:
- autoprimitive enabled with scientific Number Ignore flag
- See Also:
-
getCustomReplaceRegex
String getCustomReplaceRegex() -
getCustomReplaceSequence
String getCustomReplaceSequence() -
isReadWriteXmlNil
boolean isReadWriteXmlNil() -
isWriteNullForEmptyElements
boolean isWriteNullForEmptyElements()Used in XML->JSON conversion. Decides whether to set null or "" for an empty XML element without nil attribute- Returns:
- true if null is written, false if "" is written
-
isPreserverNamespacesForJson
boolean isPreserverNamespacesForJson()Preserves the namespace declarations in the JSON output in XML to JSON transformations.- Returns:
- preserveNamespacesForJson
-
isProcessNCNames
boolean isProcessNCNames()Builds valid XML NCNames when building XML element names in XML to JSON transformations.- Returns:
- processNCNames
-