public interface JsonXMLConfig
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.
JsonXMLInputFactory
,
JsonXMLOutputFactory
Modifier and Type | Field and Description |
---|---|
static JsonXMLConfig |
DEFAULT
Default configuration:
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCustomRegex()
Format output ignoring scientific numbers
|
java.lang.String |
getCustomReplaceRegex() |
java.lang.String |
getCustomReplaceSequence() |
char |
getNamespaceSeparator()
Namespace prefix separator.
|
javax.xml.namespace.QName |
getVirtualRoot()
JSON documents may have have multiple root properties.
|
boolean |
isAutoArray()
Trigger arrays automatically?
|
boolean |
isAutoPrimitive()
Convert element text to number/boolean/null primitives automatically?
|
boolean |
isMultiplePI()
Whether to use the
JsonXMLStreamConstants.MULTIPLE_PI_TARGET
processing instruction to indicate an array start. |
boolean |
isNamespaceDeclarations()
Whether to write namespace declarations.
|
boolean |
isPreserverNamespacesForJson()
Preserves the namespace declarations in the JSON output in XML to JSON transformations.
|
boolean |
isPrettyPrint()
Format output for better readability?
|
boolean |
isProcessNCNames()
Builds valid XML NCNames when building XML element names in XML to JSON transformations.
|
boolean |
isReadWriteXmlNil() |
boolean |
isRepairingNamespaces()
Repair namespaces when writing+>
|
boolean |
isWriteNullForEmptyElements()
Used in XML->JSON conversion.
|
static final JsonXMLConfig DEFAULT
Default configuration:
false
false
true
true
':'
false
null
boolean isAutoArray()
Trigger arrays automatically?
JsonXMLOutputFactory.PROP_AUTO_ARRAY
boolean isAutoPrimitive()
Convert element text to number/boolean/null primitives automatically?
JsonXMLOutputFactory.PROP_AUTO_ARRAY
boolean isMultiplePI()
Whether to use the JsonXMLStreamConstants.MULTIPLE_PI_TARGET
processing instruction to indicate an array start.
If true
, 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".
JsonXMLInputFactory.PROP_MULTIPLE_PI
,
JsonXMLOutputFactory.PROP_MULTIPLE_PI
boolean isNamespaceDeclarations()
Whether to write namespace declarations.
JsonXMLOutputFactory.PROP_NAMESPACE_DECLARATIONS
char getNamespaceSeparator()
Namespace prefix separator.
JsonXMLInputFactory.PROP_NAMESPACE_SEPARATOR
,
JsonXMLOutputFactory.PROP_NAMESPACE_SEPARATOR
boolean isPrettyPrint()
Format output for better readability?
JsonXMLOutputFactory.PROP_PRETTY_PRINT
javax.xml.namespace.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.
JsonXMLInputFactory.PROP_VIRTUAL_ROOT
,
JsonXMLOutputFactory.PROP_VIRTUAL_ROOT
boolean isRepairingNamespaces()
Repair namespaces when writing+>
XMLOutputFactory.IS_REPAIRING_NAMESPACES
java.lang.String getCustomRegex()
Format output ignoring scientific numbers
JsonXMLOutputFactory.PROP_CUSTOM_REGEX
java.lang.String getCustomReplaceRegex()
java.lang.String getCustomReplaceSequence()
boolean isReadWriteXmlNil()
boolean isWriteNullForEmptyElements()
boolean isPreserverNamespacesForJson()
boolean isProcessNCNames()
Copyright © 2005-2020 Apache Software Foundation. All Rights Reserved.