Class JsonXMLConfigImpl
- All Implemented Interfaces:
Cloneable,JsonXMLConfig
Simple JSON XML configuration.
Initially, values are set according to JsonXMLConfig.DEFAULT.
- See Also:
-
Field Summary
Fields inherited from interface org.apache.synapse.commons.staxon.core.json.JsonXMLConfig
DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected JsonXMLConfigImplclone()Format 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.voidsetAutoArray(boolean autoArray) voidsetAutoPrimitive(boolean autoPrimitive) voidsetCustomRegex(String customRegex) voidsetCustomReplaceRegex(String customReplaceRegex) voidsetCustomReplaceSequence(String customReplaceSequence) voidsetMultiplePI(boolean multiplePI) voidsetNamespaceDeclarations(boolean namespaceDeclarations) voidsetNamespaceSeparator(char namespaceSeparator) voidsetPreserverNamespacesForJson(boolean preserverNamespacesForJson) voidsetPrettyPrint(boolean prettyPrint) voidsetProcessNCNames(boolean processNCNames) voidsetReadWriteXmlNil(boolean readWriteXmlNil) voidsetRepairingNamespaces(boolean repairingNamespaces) voidsetVirtualRoot(QName virtualRoot) voidsetWriteNullForEmptyElement(boolean writeNullForEmptyElement)
-
Constructor Details
-
JsonXMLConfigImpl
public JsonXMLConfigImpl()
-
-
Method Details
-
clone
-
isAutoArray
public boolean isAutoArray()Description copied from interface:JsonXMLConfigTrigger arrays automatically?
- Specified by:
isAutoArrayin interfaceJsonXMLConfig- Returns:
- auto array flag
- See Also:
-
setAutoArray
public void setAutoArray(boolean autoArray) -
isAutoPrimitive
public boolean isAutoPrimitive()Description copied from interface:JsonXMLConfigConvert element text to number/boolean/null primitives automatically?
- Specified by:
isAutoPrimitivein interfaceJsonXMLConfig- Returns:
- auto primitive flag
- See Also:
-
setAutoPrimitive
public void setAutoPrimitive(boolean autoPrimitive) -
isMultiplePI
public boolean isMultiplePI()Description copied from interface:JsonXMLConfigWhether 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".
- Specified by:
isMultiplePIin interfaceJsonXMLConfig- Returns:
- multiple PI flag
- See Also:
-
setMultiplePI
public void setMultiplePI(boolean multiplePI) -
isNamespaceDeclarations
public boolean isNamespaceDeclarations()Description copied from interface:JsonXMLConfigWhether to write namespace declarations.
- Specified by:
isNamespaceDeclarationsin interfaceJsonXMLConfig- Returns:
- namespace declarations flag
- See Also:
-
setNamespaceDeclarations
public void setNamespaceDeclarations(boolean namespaceDeclarations) -
getNamespaceSeparator
public char getNamespaceSeparator()Description copied from interface:JsonXMLConfigNamespace prefix separator.
- Specified by:
getNamespaceSeparatorin interfaceJsonXMLConfig- Returns:
- namespace separator
- See Also:
-
setNamespaceSeparator
public void setNamespaceSeparator(char namespaceSeparator) -
isPrettyPrint
public boolean isPrettyPrint()Description copied from interface:JsonXMLConfigFormat output for better readability?
- Specified by:
isPrettyPrintin interfaceJsonXMLConfig- Returns:
- pretty print flag
- See Also:
-
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint) -
getVirtualRoot
Description copied from interface:JsonXMLConfigJSON 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.
- Specified by:
getVirtualRootin interfaceJsonXMLConfig- Returns:
- virtual root
- See Also:
-
setVirtualRoot
-
isRepairingNamespaces
public boolean isRepairingNamespaces()Description copied from interface:JsonXMLConfigRepair namespaces when writinginvalid input: '<'/+>
- Specified by:
isRepairingNamespacesin interfaceJsonXMLConfig- Returns:
- namespace-repairing flag
- See Also:
-
setRepairingNamespaces
public void setRepairingNamespaces(boolean repairingNamespaces) -
getCustomRegex
Description copied from interface:JsonXMLConfigFormat output ignoring scientific numbers
- Specified by:
getCustomRegexin interfaceJsonXMLConfig- Returns:
- autoprimitive enabled with scientific Number Ignore flag
- See Also:
-
setCustomRegex
-
getCustomReplaceRegex
- Specified by:
getCustomReplaceRegexin interfaceJsonXMLConfig
-
setCustomReplaceRegex
-
getCustomReplaceSequence
- Specified by:
getCustomReplaceSequencein interfaceJsonXMLConfig
-
setCustomReplaceSequence
-
setReadWriteXmlNil
public void setReadWriteXmlNil(boolean readWriteXmlNil) -
setWriteNullForEmptyElement
public void setWriteNullForEmptyElement(boolean writeNullForEmptyElement) -
isReadWriteXmlNil
public boolean isReadWriteXmlNil()- Specified by:
isReadWriteXmlNilin interfaceJsonXMLConfig
-
isWriteNullForEmptyElements
public boolean isWriteNullForEmptyElements()Description copied from interface:JsonXMLConfigUsed in XML->JSON conversion. Decides whether to set null or "" for an empty XML element without nil attribute- Specified by:
isWriteNullForEmptyElementsin interfaceJsonXMLConfig- Returns:
- true if null is written, false if "" is written
-
isPreserverNamespacesForJson
public boolean isPreserverNamespacesForJson()Description copied from interface:JsonXMLConfigPreserves the namespace declarations in the JSON output in XML to JSON transformations.- Specified by:
isPreserverNamespacesForJsonin interfaceJsonXMLConfig- Returns:
- preserveNamespacesForJson
-
setPreserverNamespacesForJson
public void setPreserverNamespacesForJson(boolean preserverNamespacesForJson) -
isProcessNCNames
public boolean isProcessNCNames()Description copied from interface:JsonXMLConfigBuilds valid XML NCNames when building XML element names in XML to JSON transformations.- Specified by:
isProcessNCNamesin interfaceJsonXMLConfig- Returns:
- processNCNames
-
setProcessNCNames
public void setProcessNCNames(boolean processNCNames)
-