de.odysseus.staxon.json
Interface JsonXMLConfig

All Known Implementing Classes:
JsonXMLConfigImpl

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.

See Also:
JsonXMLInputFactory, JsonXMLOutputFactory

Field Summary
static JsonXMLConfig DEFAULT
          Default configuration:
 
Method Summary
 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
 

Field Detail

DEFAULT

static final JsonXMLConfig DEFAULT

Default configuration:

Method Detail

isAutoArray

boolean isAutoArray()

Trigger arrays automatically?

Returns:
auto array flag
See Also:
JsonXMLOutputFactory.PROP_AUTO_ARRAY

isAutoPrimitive

boolean isAutoPrimitive()

Convert element text to number/boolean/null primitives automatically?

Returns:
auto primitive flag
See Also:
JsonXMLOutputFactory.PROP_AUTO_ARRAY

isMultiplePI

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.

If 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:
JsonXMLInputFactory.PROP_MULTIPLE_PI, JsonXMLOutputFactory.PROP_MULTIPLE_PI

isNamespaceDeclarations

boolean isNamespaceDeclarations()

Whether to write namespace declarations.

Returns:
namespace declarations flag
See Also:
JsonXMLOutputFactory.PROP_NAMESPACE_DECLARATIONS

getNamespaceSeparator

char getNamespaceSeparator()

Namespace prefix separator.

Returns:
namespace separator
See Also:
JsonXMLInputFactory.PROP_NAMESPACE_SEPARATOR, JsonXMLOutputFactory.PROP_NAMESPACE_SEPARATOR

isPrettyPrint

boolean isPrettyPrint()

Format output for better readability?

Returns:
pretty print flag
See Also:
JsonXMLOutputFactory.PROP_PRETTY_PRINT

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:
JsonXMLInputFactory.PROP_VIRTUAL_ROOT, JsonXMLOutputFactory.PROP_VIRTUAL_ROOT

isRepairingNamespaces

boolean isRepairingNamespaces()

Repair namespaces when writing

Returns:
namespace-repairing flag
See Also:
XMLOutputFactory.IS_REPAIRING_NAMESPACES


Copyright © 2011-2012. All Rights Reserved.