|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.xml.stream.XMLOutputFactory
de.odysseus.staxon.base.AbstractXMLOutputFactory
de.odysseus.staxon.json.JsonXMLOutputFactory
public class JsonXMLOutputFactory
XML output factory for streaming to JSON.
| Field Summary | |
|---|---|
static String |
PROP_AUTO_ARRAY
Start/end arrays automatically? |
static String |
PROP_AUTO_PRIMITIVE
Convert element text to JSON primitives (number, boolean, null) automatically? |
static String |
PROP_MULTIPLE_PI
Whether to use the JsonXMLStreamConstants.MULTIPLE_PI_TARGET
processing instruction target to trigger an array start. |
static String |
PROP_NAMESPACE_DECLARATIONS
Whether to write namespace declarations. |
static String |
PROP_NAMESPACE_SEPARATOR
Namespace prefix separator. |
static String |
PROP_PRETTY_PRINT
Format output for better readability? |
static String |
PROP_VIRTUAL_ROOT
JSON documents may have have multiple root properties. |
| Fields inherited from class javax.xml.stream.XMLOutputFactory |
|---|
IS_REPAIRING_NAMESPACES |
| Constructor Summary | |
|---|---|
JsonXMLOutputFactory()
|
|
JsonXMLOutputFactory(JsonStreamFactory streamFactory)
|
|
JsonXMLOutputFactory(JsonXMLConfig config)
|
|
JsonXMLOutputFactory(JsonXMLConfig config,
JsonStreamFactory streamFactory)
|
|
| Method Summary | |
|---|---|
XMLEventWriter |
createXMLEventWriter(XMLStreamWriter writer)
|
JsonXMLStreamWriter |
createXMLStreamWriter(OutputStream stream)
|
JsonXMLStreamWriter |
createXMLStreamWriter(OutputStream stream,
String encoding)
|
JsonXMLStreamWriter |
createXMLStreamWriter(Writer stream)
|
Object |
getProperty(String name)
|
boolean |
isPropertySupported(String name)
|
void |
setProperty(String name,
Object value)
|
| Methods inherited from class de.odysseus.staxon.base.AbstractXMLOutputFactory |
|---|
createXMLEventWriter, createXMLEventWriter, createXMLEventWriter, createXMLEventWriter, createXMLStreamWriter |
| Methods inherited from class javax.xml.stream.XMLOutputFactory |
|---|
newFactory, newFactory, newInstance, newInstance |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROP_AUTO_ARRAY
Start/end arrays automatically?
The default value is false.
public static final String PROP_AUTO_PRIMITIVE
Convert element text to JSON primitives (number, boolean, null) automatically?
The default value is false.
public static final String PROP_MULTIPLE_PI
Whether to use the JsonXMLStreamConstants.MULTIPLE_PI_TARGET
processing instruction target to trigger 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.
Note that the element given in the PI may be written zero times, indicating an empty array.
The default value is true.
public static final String 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.
public static final String PROP_NAMESPACE_SEPARATOR
Namespace prefix separator.
The default value is ':'.
public static final String PROP_NAMESPACE_DECLARATIONS
Whether to write namespace declarations.
The default value is true.
public static final String PROP_PRETTY_PRINT
Format output for better readability?
The default value is false.
| Constructor Detail |
|---|
public JsonXMLOutputFactory()
throws FactoryConfigurationError
FactoryConfigurationErrorpublic JsonXMLOutputFactory(JsonStreamFactory streamFactory)
public JsonXMLOutputFactory(JsonXMLConfig config)
throws FactoryConfigurationError
FactoryConfigurationError
public JsonXMLOutputFactory(JsonXMLConfig config,
JsonStreamFactory streamFactory)
| Method Detail |
|---|
public JsonXMLStreamWriter createXMLStreamWriter(OutputStream stream,
String encoding)
throws XMLStreamException
createXMLStreamWriter in class XMLOutputFactoryXMLStreamException
public JsonXMLStreamWriter createXMLStreamWriter(Writer stream)
throws XMLStreamException
createXMLStreamWriter in class XMLOutputFactoryXMLStreamException
public JsonXMLStreamWriter createXMLStreamWriter(OutputStream stream)
throws XMLStreamException
createXMLStreamWriter in class XMLOutputFactoryXMLStreamException
public XMLEventWriter createXMLEventWriter(XMLStreamWriter writer)
throws XMLStreamException
createXMLEventWriter in class AbstractXMLOutputFactoryXMLStreamExceptionpublic boolean isPropertySupported(String name)
isPropertySupported in class AbstractXMLOutputFactory
public Object getProperty(String name)
throws IllegalArgumentException
getProperty in class AbstractXMLOutputFactoryIllegalArgumentException
public void setProperty(String name,
Object value)
throws IllegalArgumentException
setProperty in class AbstractXMLOutputFactoryIllegalArgumentException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||