public class JsonXMLConfigImpl extends java.lang.Object implements JsonXMLConfig, java.lang.Cloneable
Simple JSON XML configuration.
Initially, values are set according to JsonXMLConfig.DEFAULT
.
JsonXMLConfig
DEFAULT
Constructor and Description |
---|
JsonXMLConfigImpl() |
Modifier and Type | Method and Description |
---|---|
protected JsonXMLConfigImpl |
clone() |
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.
|
void |
setAutoArray(boolean autoArray) |
void |
setAutoPrimitive(boolean autoPrimitive) |
void |
setCustomRegex(java.lang.String customRegex) |
void |
setCustomReplaceRegex(java.lang.String customReplaceRegex) |
void |
setCustomReplaceSequence(java.lang.String customReplaceSequence) |
void |
setMultiplePI(boolean multiplePI) |
void |
setNamespaceDeclarations(boolean namespaceDeclarations) |
void |
setNamespaceSeparator(char namespaceSeparator) |
void |
setPreserverNamespacesForJson(boolean preserverNamespacesForJson) |
void |
setPrettyPrint(boolean prettyPrint) |
void |
setProcessNCNames(boolean processNCNames) |
void |
setReadWriteXmlNil(boolean readWriteXmlNil) |
void |
setRepairingNamespaces(boolean repairingNamespaces) |
void |
setVirtualRoot(javax.xml.namespace.QName virtualRoot) |
void |
setWriteNullForEmptyElement(boolean writeNullForEmptyElement) |
protected JsonXMLConfigImpl clone()
clone
in class java.lang.Object
public boolean isAutoArray()
JsonXMLConfig
Trigger arrays automatically?
isAutoArray
in interface JsonXMLConfig
JsonXMLOutputFactory.PROP_AUTO_ARRAY
public void setAutoArray(boolean autoArray)
public boolean isAutoPrimitive()
JsonXMLConfig
Convert element text to number/boolean/null primitives automatically?
isAutoPrimitive
in interface JsonXMLConfig
JsonXMLOutputFactory.PROP_AUTO_ARRAY
public void setAutoPrimitive(boolean autoPrimitive)
public boolean isMultiplePI()
JsonXMLConfig
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".
isMultiplePI
in interface JsonXMLConfig
JsonXMLInputFactory.PROP_MULTIPLE_PI
,
JsonXMLOutputFactory.PROP_MULTIPLE_PI
public void setMultiplePI(boolean multiplePI)
public boolean isNamespaceDeclarations()
JsonXMLConfig
Whether to write namespace declarations.
isNamespaceDeclarations
in interface JsonXMLConfig
JsonXMLOutputFactory.PROP_NAMESPACE_DECLARATIONS
public void setNamespaceDeclarations(boolean namespaceDeclarations)
public char getNamespaceSeparator()
JsonXMLConfig
Namespace prefix separator.
getNamespaceSeparator
in interface JsonXMLConfig
JsonXMLInputFactory.PROP_NAMESPACE_SEPARATOR
,
JsonXMLOutputFactory.PROP_NAMESPACE_SEPARATOR
public void setNamespaceSeparator(char namespaceSeparator)
public boolean isPrettyPrint()
JsonXMLConfig
Format output for better readability?
isPrettyPrint
in interface JsonXMLConfig
JsonXMLOutputFactory.PROP_PRETTY_PRINT
public void setPrettyPrint(boolean prettyPrint)
public javax.xml.namespace.QName getVirtualRoot()
JsonXMLConfig
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.
getVirtualRoot
in interface JsonXMLConfig
JsonXMLInputFactory.PROP_VIRTUAL_ROOT
,
JsonXMLOutputFactory.PROP_VIRTUAL_ROOT
public void setVirtualRoot(javax.xml.namespace.QName virtualRoot)
public boolean isRepairingNamespaces()
JsonXMLConfig
Repair namespaces when writing+>
isRepairingNamespaces
in interface JsonXMLConfig
XMLOutputFactory.IS_REPAIRING_NAMESPACES
public void setRepairingNamespaces(boolean repairingNamespaces)
public java.lang.String getCustomRegex()
JsonXMLConfig
Format output ignoring scientific numbers
getCustomRegex
in interface JsonXMLConfig
JsonXMLOutputFactory.PROP_CUSTOM_REGEX
public void setCustomRegex(java.lang.String customRegex)
public java.lang.String getCustomReplaceRegex()
getCustomReplaceRegex
in interface JsonXMLConfig
public void setCustomReplaceRegex(java.lang.String customReplaceRegex)
public java.lang.String getCustomReplaceSequence()
getCustomReplaceSequence
in interface JsonXMLConfig
public void setCustomReplaceSequence(java.lang.String customReplaceSequence)
public void setReadWriteXmlNil(boolean readWriteXmlNil)
public void setWriteNullForEmptyElement(boolean writeNullForEmptyElement)
public boolean isReadWriteXmlNil()
isReadWriteXmlNil
in interface JsonXMLConfig
public boolean isWriteNullForEmptyElements()
JsonXMLConfig
isWriteNullForEmptyElements
in interface JsonXMLConfig
public boolean isPreserverNamespacesForJson()
JsonXMLConfig
isPreserverNamespacesForJson
in interface JsonXMLConfig
public void setPreserverNamespacesForJson(boolean preserverNamespacesForJson)
public boolean isProcessNCNames()
JsonXMLConfig
isProcessNCNames
in interface JsonXMLConfig
public void setProcessNCNames(boolean processNCNames)
Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.