Class JsonXMLInputFactory
java.lang.Object
javax.xml.stream.XMLInputFactory
org.apache.synapse.commons.staxon.core.base.AbstractXMLInputFactory
org.apache.synapse.commons.staxon.core.json.JsonXMLInputFactory
XML input factory for streaming from JSON.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWhether to use theJsonXMLStreamConstants.MULTIPLE_PI_TARGETprocessing instruction to indicate an array start.static final StringNamespace prefix separator.static final StringJSON documents may have have multiple root properties.Fields inherited from class javax.xml.stream.XMLInputFactory
ALLOCATOR, IS_COALESCING, IS_NAMESPACE_AWARE, IS_REPLACING_ENTITY_REFERENCES, IS_SUPPORTING_EXTERNAL_ENTITIES, IS_VALIDATING, REPORTER, RESOLVER, SUPPORT_DTD -
Constructor Summary
ConstructorsConstructorDescriptionJsonXMLInputFactory(JsonXMLConfig config) JsonXMLInputFactory(JsonXMLConfig config, JsonStreamFactory streamFactory) JsonXMLInputFactory(JsonStreamFactory streamFactory) -
Method Summary
Modifier and TypeMethodDescriptioncreateFilteredReader(XMLEventReader reader, EventFilter filter) createXMLEventReader(XMLStreamReader reader) createXMLStreamReader(InputStream stream) createXMLStreamReader(InputStream stream, String encoding) createXMLStreamReader(InputStream stream, Constants.SCANNER scanner) createXMLStreamReader(Reader reader) createXMLStreamReader(Reader reader, Constants.SCANNER scanner) createXMLStreamReader(String systemId, InputStream stream) createXMLStreamReader(String systemId, Reader reader) getProperty(String name) booleanisPropertySupported(String name) voidsetProperty(String name, Object value) voidsetXMLReporter(XMLReporter reporter) voidsetXMLResolver(XMLResolver resolver) Methods inherited from class org.apache.synapse.commons.staxon.core.base.AbstractXMLInputFactory
createFilteredReader, createXMLEventReader, createXMLEventReader, createXMLEventReader, createXMLEventReader, createXMLEventReader, createXMLEventReader, createXMLStreamReader, getEventAllocator, getXMLReporter, getXMLResolver, setEventAllocatorMethods inherited from class javax.xml.stream.XMLInputFactory
newDefaultFactory, newFactory, newFactory, newInstance, newInstance
-
Field Details
-
PROP_MULTIPLE_PI
Whether to use the
JsonXMLStreamConstants.MULTIPLE_PI_TARGETprocessing instruction to indicate an array start. Iftrue, 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".
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 added to the stream when reading.
The default value is
null.- See Also:
-
PROP_NAMESPACE_SEPARATOR
Namespace prefix separator.
The default value is
':'.- See Also:
-
-
Constructor Details
-
JsonXMLInputFactory
- Throws:
FactoryConfigurationError
-
JsonXMLInputFactory
-
JsonXMLInputFactory
- Throws:
FactoryConfigurationError
-
JsonXMLInputFactory
-
-
Method Details
-
createXMLStreamReader
public JsonXMLStreamReader createXMLStreamReader(InputStream stream, String encoding) throws XMLStreamException - Specified by:
createXMLStreamReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLStreamReader
public JsonXMLStreamReader createXMLStreamReader(String systemId, InputStream stream) throws XMLStreamException - Specified by:
createXMLStreamReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLStreamReader
public JsonXMLStreamReader createXMLStreamReader(String systemId, Reader reader) throws XMLStreamException - Specified by:
createXMLStreamReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLStreamReader
- Specified by:
createXMLStreamReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLStreamReader
public JsonXMLStreamReader createXMLStreamReader(Reader reader, Constants.SCANNER scanner) throws XMLStreamException - Throws:
XMLStreamException
-
createXMLStreamReader
- Specified by:
createXMLStreamReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createXMLStreamReader
public JsonXMLStreamReader createXMLStreamReader(InputStream stream, Constants.SCANNER scanner) throws XMLStreamException - Throws:
XMLStreamException
-
createXMLEventReader
- Specified by:
createXMLEventReaderin classXMLInputFactory- Throws:
XMLStreamException
-
createFilteredReader
public XMLEventReader createFilteredReader(XMLEventReader reader, EventFilter filter) throws XMLStreamException - Specified by:
createFilteredReaderin classXMLInputFactory- Throws:
XMLStreamException
-
setXMLResolver
- Overrides:
setXMLResolverin classAbstractXMLInputFactory
-
setXMLReporter
- Overrides:
setXMLReporterin classAbstractXMLInputFactory
-
isPropertySupported
- Overrides:
isPropertySupportedin classAbstractXMLInputFactory
-
getProperty
- Overrides:
getPropertyin classAbstractXMLInputFactory- Throws:
IllegalArgumentException
-
setProperty
- Overrides:
setPropertyin classAbstractXMLInputFactory- Throws:
IllegalArgumentException
-