org.apache.synapse.commons.staxon.core.json

## 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

-     public class JsonXMLInputFactory
      extends AbstractXMLInputFactory

  XML input factory for streaming from JSON.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `PROP_MULTIPLE_PI` Whether to use the `JsonXMLStreamConstants.MULTIPLE_PI_TARGET` processing instruction to indicate an array start.
    `static java.lang.String` | `PROP_NAMESPACE_SEPARATOR` Namespace prefix separator.
    `static java.lang.String` | `PROP_VIRTUAL_ROOT` JSON 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

    Constructors
    Constructor and Description
    `JsonXMLInputFactory()`
    `JsonXMLInputFactory(JsonStreamFactory streamFactory)`
    `JsonXMLInputFactory(JsonXMLConfig config)`
    `JsonXMLInputFactory(JsonXMLConfig config, JsonStreamFactory streamFactory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.xml.stream.XMLEventReader` | `createFilteredReader(javax.xml.stream.XMLEventReader reader, javax.xml.stream.EventFilter filter)`
    `javax.xml.stream.XMLEventReader` | `createXMLEventReader(javax.xml.stream.XMLStreamReader reader)`
    `JsonXMLStreamReader` | `createXMLStreamReader(java.io.InputStream stream)`
    `JsonXMLStreamReader` | `createXMLStreamReader(java.io.InputStream stream, Constants.SCANNER scanner)`
    `JsonXMLStreamReader` | `createXMLStreamReader(java.io.InputStream stream, java.lang.String encoding)`
    `JsonXMLStreamReader` | `createXMLStreamReader(java.io.Reader reader)`
    `JsonXMLStreamReader` | `createXMLStreamReader(java.io.Reader reader, Constants.SCANNER scanner)`
    `JsonXMLStreamReader` | `createXMLStreamReader(java.lang.String systemId, java.io.InputStream stream)`
    `JsonXMLStreamReader` | `createXMLStreamReader(java.lang.String systemId, java.io.Reader reader)`
    `java.lang.Object` | `getProperty(java.lang.String name)`
    `boolean` | `isPropertySupported(java.lang.String name)`
    `void` | `setProperty(java.lang.String name, java.lang.Object value)`
    `void` | `setXMLReporter(javax.xml.stream.XMLReporter reporter)`
    `void` | `setXMLResolver(javax.xml.stream.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, setEventAllocator`

    - ### Methods inherited from class javax.xml.stream.XMLInputFactory

      `newFactory, newFactory, newInstance, newInstance`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PROP_MULTIPLE_PI

          public static final java.lang.String PROP_MULTIPLE_PI

      Whether to use the `JsonXMLStreamConstants.MULTIPLE_PI_TARGET` processing instruction to indicate an array start. 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".

      The default value is `true`.

      See Also:
        Constant Field Values

    - #### PROP_VIRTUAL_ROOT

          public static final java.lang.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 added to the stream when reading.

      The default value is `null`.

      See Also:
        Constant Field Values

    - #### PROP_NAMESPACE_SEPARATOR

          public static final java.lang.String PROP_NAMESPACE_SEPARATOR

      Namespace prefix separator.

      The default value is `':'`.

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### JsonXMLInputFactory

          public JsonXMLInputFactory()
                              throws javax.xml.stream.FactoryConfigurationError

      Throws:
        `javax.xml.stream.FactoryConfigurationError`

    - #### JsonXMLInputFactory

          public JsonXMLInputFactory(JsonStreamFactory streamFactory)

    - #### JsonXMLInputFactory

          public JsonXMLInputFactory(JsonXMLConfig config)
                              throws javax.xml.stream.FactoryConfigurationError

      Throws:
        `javax.xml.stream.FactoryConfigurationError`

    - #### JsonXMLInputFactory

          public JsonXMLInputFactory(JsonXMLConfig config,
                                     JsonStreamFactory streamFactory)

  - ### Method Detail

    - #### createXMLStreamReader

          public JsonXMLStreamReader createXMLStreamReader(java.io.InputStream stream,
                                                           java.lang.String encoding)
                                                    throws javax.xml.stream.XMLStreamException

      Specified by:
        `createXMLStreamReader` in class `javax.xml.stream.XMLInputFactory`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### createXMLStreamReader

          public JsonXMLStreamReader createXMLStreamReader(java.lang.String systemId,
                                                           java.io.InputStream stream)
                                                    throws javax.xml.stream.XMLStreamException

      Specified by:
        `createXMLStreamReader` in class `javax.xml.stream.XMLInputFactory`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### createXMLStreamReader

          public JsonXMLStreamReader createXMLStreamReader(java.lang.String systemId,
                                                           java.io.Reader reader)
                                                    throws javax.xml.stream.XMLStreamException

      Specified by:
        `createXMLStreamReader` in class `javax.xml.stream.XMLInputFactory`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### createXMLStreamReader

          public JsonXMLStreamReader createXMLStreamReader(java.io.Reader reader)
                                                    throws javax.xml.stream.XMLStreamException

      Specified by:
        `createXMLStreamReader` in class `javax.xml.stream.XMLInputFactory`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### createXMLStreamReader

          public JsonXMLStreamReader createXMLStreamReader(java.io.Reader reader,
                                                           Constants.SCANNER scanner)
                                                    throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### createXMLStreamReader

          public JsonXMLStreamReader createXMLStreamReader(java.io.InputStream stream)
                                                    throws javax.xml.stream.XMLStreamException

      Specified by:
        `createXMLStreamReader` in class `javax.xml.stream.XMLInputFactory`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### createXMLStreamReader

          public JsonXMLStreamReader createXMLStreamReader(java.io.InputStream stream,
                                                           Constants.SCANNER scanner)
                                                    throws javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### createXMLEventReader

          public javax.xml.stream.XMLEventReader createXMLEventReader(javax.xml.stream.XMLStreamReader reader)
                                                               throws javax.xml.stream.XMLStreamException

      Specified by:
        `createXMLEventReader` in class `javax.xml.stream.XMLInputFactory`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### createFilteredReader

          public javax.xml.stream.XMLEventReader createFilteredReader(javax.xml.stream.XMLEventReader reader,
                                                                      javax.xml.stream.EventFilter filter)
                                                               throws javax.xml.stream.XMLStreamException

      Specified by:
        `createFilteredReader` in class `javax.xml.stream.XMLInputFactory`
      Throws:
        `javax.xml.stream.XMLStreamException`

    - #### setXMLResolver

          public void setXMLResolver(javax.xml.stream.XMLResolver resolver)

      Overrides:
        `setXMLResolver` in class `AbstractXMLInputFactory`

    - #### setXMLReporter

          public void setXMLReporter(javax.xml.stream.XMLReporter reporter)

      Overrides:
        `setXMLReporter` in class `AbstractXMLInputFactory`

    - #### isPropertySupported

          public boolean isPropertySupported(java.lang.String name)

      Overrides:
        `isPropertySupported` in class `AbstractXMLInputFactory`

    - #### getProperty

          public java.lang.Object getProperty(java.lang.String name)
                                       throws java.lang.IllegalArgumentException

      Overrides:
        `getProperty` in class `AbstractXMLInputFactory`
      Throws:
        `java.lang.IllegalArgumentException`

    - #### setProperty

          public void setProperty(java.lang.String name,
                                  java.lang.Object value)
                           throws java.lang.IllegalArgumentException

      Overrides:
        `setProperty` in class `AbstractXMLInputFactory`
      Throws:
        `java.lang.IllegalArgumentException`

Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.