public class JsonXMLConfigImpl extends Object implements JsonXMLConfig, 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() |
String |
getCustomRegex()
Format output ignoring scientific numbers
|
String |
getCustomReplaceRegex() |
String |
getCustomReplaceSequence() |
char |
getNamespaceSeparator()
Namespace prefix separator.
|
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 |
isPrettyPrint()
Format output for better readability?
|
boolean |
isRepairingNamespaces()
Repair namespaces when writing+>
|
void |
setAutoArray(boolean autoArray) |
void |
setAutoPrimitive(boolean autoPrimitive) |
void |
setCustomRegex(String customRegex) |
void |
setCustomReplaceRegex(String customReplaceRegex) |
void |
setCustomReplaceSequence(String customReplaceSequence) |
void |
setMultiplePI(boolean multiplePI) |
void |
setNamespaceDeclarations(boolean namespaceDeclarations) |
void |
setNamespaceSeparator(char namespaceSeparator) |
void |
setPrettyPrint(boolean prettyPrint) |
void |
setRepairingNamespaces(boolean repairingNamespaces) |
void |
setVirtualRoot(QName virtualRoot) |
protected JsonXMLConfigImpl clone()
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 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(QName virtualRoot)
public boolean isRepairingNamespaces()
JsonXMLConfig
Repair namespaces when writing+>
isRepairingNamespaces
in interface JsonXMLConfig
XMLOutputFactory.IS_REPAIRING_NAMESPACES
public void setRepairingNamespaces(boolean repairingNamespaces)
public String getCustomRegex()
JsonXMLConfig
Format output ignoring scientific numbers
getCustomRegex
in interface JsonXMLConfig
JsonXMLOutputFactory.PROP_CUSTOM_REGEX
public void setCustomRegex(String customRegex)
public String getCustomReplaceRegex()
getCustomReplaceRegex
in interface JsonXMLConfig
public void setCustomReplaceRegex(String customReplaceRegex)
public String getCustomReplaceSequence()
getCustomReplaceSequence
in interface JsonXMLConfig
public void setCustomReplaceSequence(String customReplaceSequence)
Copyright © 2005–2017 Apache Software Foundation. All rights reserved.