Class JsonXMLOutputFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringStart/end arrays automatically?static final StringConvert element text to JSON primitives (number, boolean, null) automatically?static final StringConvert element text to JSON primitives with ignore given regex (number, boolean, null) automatically?static final Stringstatic final Stringstatic final StringWhether to use theJsonXMLStreamConstants.MULTIPLE_PI_TARGETprocessing instruction target to trigger an array start.static final StringWhether to write namespace declarations.static final StringNamespace prefix separator.static final StringFormat output for better readability?static final StringJSON documents may have have multiple root properties.Fields inherited from class javax.xml.stream.XMLOutputFactory
IS_REPAIRING_NAMESPACES -
Constructor Summary
ConstructorsConstructorDescriptionJsonXMLOutputFactory(JsonXMLConfig config) JsonXMLOutputFactory(JsonXMLConfig config, JsonStreamFactory streamFactory) JsonXMLOutputFactory(JsonStreamFactory streamFactory) -
Method Summary
Modifier and TypeMethodDescriptioncreateXMLEventWriter(XMLStreamWriter writer) createXMLStreamWriter(OutputStream stream) createXMLStreamWriter(OutputStream stream, String encoding) createXMLStreamWriter(Writer stream) getProperty(String name) booleanisPropertySupported(String name) voidsetProperty(String name, Object value) Methods inherited from class org.apache.synapse.commons.staxon.core.base.AbstractXMLOutputFactory
createXMLEventWriter, createXMLEventWriter, createXMLEventWriter, createXMLEventWriter, createXMLStreamWriterMethods inherited from class javax.xml.stream.XMLOutputFactory
newDefaultFactory, newFactory, newFactory, newInstance, newInstance
-
Field Details
-
PROP_AUTO_ARRAY
Start/end arrays automatically?
The default value is
false.- See Also:
-
PROP_AUTO_PRIMITIVE
Convert element text to JSON primitives (number, boolean, null) automatically?
The default value is
false.- See Also:
-
PROP_MULTIPLE_PI
Whether to use the
JsonXMLStreamConstants.MULTIPLE_PI_TARGETprocessing instruction target to trigger 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.Note that the element given in the PI may be written zero times, indicating an empty array.
The default value is true.
- See Also:
-
PROP_VIRTUAL_ROOT
JSON documents may have have multiple root properties. However, XML requires a single root element. This property takes the name of a "virtual" root element, which will be removed from the stream when writing.
The default value is
null.- See Also:
-
PROP_NAMESPACE_SEPARATOR
Namespace prefix separator.
The default value is
':'.- See Also:
-
PROP_NAMESPACE_DECLARATIONS
Whether to write namespace declarations.
The default value is
true.- See Also:
-
PROP_PRETTY_PRINT
Format output for better readability?
The default value is
false.- See Also:
-
PROP_CUSTOM_REGEX
Convert element text to JSON primitives with ignore given regex (number, boolean, null) automatically?
The default value is
null.- See Also:
-
PROP_CUSTOM_REPLACE_REGEX
- See Also:
-
PROP_CUSTOM_REPLACE_SEQUENCE
- See Also:
-
-
Constructor Details
-
JsonXMLOutputFactory
- Throws:
FactoryConfigurationError
-
JsonXMLOutputFactory
-
JsonXMLOutputFactory
- Throws:
FactoryConfigurationError
-
JsonXMLOutputFactory
-
-
Method Details
-
createXMLStreamWriter
public JsonXMLStreamWriter createXMLStreamWriter(OutputStream stream, String encoding) throws XMLStreamException - Specified by:
createXMLStreamWriterin classXMLOutputFactory- Throws:
XMLStreamException
-
createXMLStreamWriter
- Specified by:
createXMLStreamWriterin classXMLOutputFactory- Throws:
XMLStreamException
-
createXMLStreamWriter
- Specified by:
createXMLStreamWriterin classXMLOutputFactory- Throws:
XMLStreamException
-
createXMLEventWriter
- Specified by:
createXMLEventWriterin classAbstractXMLOutputFactory- Throws:
XMLStreamException
-
isPropertySupported
- Overrides:
isPropertySupportedin classAbstractXMLOutputFactory
-
getProperty
- Overrides:
getPropertyin classAbstractXMLOutputFactory- Throws:
IllegalArgumentException
-
setProperty
- Overrides:
setPropertyin classAbstractXMLOutputFactory- Throws:
IllegalArgumentException
-
getConfig
-