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

## Class JsonXMLBinder

- java.lang.Object
- - org.apache.synapse.commons.staxon.core.json.jaxb.JsonXMLBinder

-     public class JsonXMLBinder
      extends java.lang.Object

  Read/write instances of JAXB-annotated classes from/to JSON.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `JsonXMLBinder()`
    `protected` | `JsonXMLBinder(boolean writeDocumentArray)`
    `protected` | `JsonXMLBinder(JsonXMLRootProvider rootProvider, boolean writeDocumentArray)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected JsonXMLInputFactory` | `createInputFactory(java.lang.Class<?> type, JsonXML config)`
    `protected JsonXMLOutputFactory` | `createOutputFactory(java.lang.Class<?> type, JsonXML config)`
    `protected javax.xml.stream.XMLStreamReader` | `createXMLStreamReader(java.lang.Class<?> type, JsonXML config, java.io.Reader stream)`
    `protected javax.xml.stream.XMLStreamWriter` | `createXMLStreamWriter(java.lang.Class<?> type, JsonXML config, java.io.Writer stream)`
    `boolean` | `isBindable(java.lang.Class<?> type)`
    `protected void` | `marshal(java.lang.Class<?> type, JsonXML config, javax.xml.bind.Marshaller marshaller, javax.xml.stream.XMLStreamWriter writer, java.lang.Object value)`
    `<T> java.util.List<T>` | `readArray(java.lang.Class<? extends T> type, JsonXML config, javax.xml.bind.JAXBContext context, java.io.Reader stream)`
    `<T> T` | `readObject(java.lang.Class<? extends T> type, JsonXML config, javax.xml.bind.JAXBContext context, java.io.Reader stream)`
    `protected <T> T` | `unmarshal(java.lang.Class<? extends T> type, JsonXML config, javax.xml.bind.Unmarshaller unmarshaller, javax.xml.stream.XMLStreamReader reader)`
    `void` | `writeArray(java.lang.Class<?> type, JsonXML config, javax.xml.bind.JAXBContext context, java.io.Writer stream, java.util.Collection<?> collection)`
    `void` | `writeObject(java.lang.Class<?> type, JsonXML config, javax.xml.bind.JAXBContext context, java.io.Writer stream, java.lang.Object value)`

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

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

- - ### Constructor Detail

    - #### JsonXMLBinder

          public JsonXMLBinder()

    - #### JsonXMLBinder

          protected JsonXMLBinder(boolean writeDocumentArray)

    - #### JsonXMLBinder

          protected JsonXMLBinder(JsonXMLRootProvider rootProvider,
                                  boolean writeDocumentArray)

  - ### Method Detail

    - #### createInputFactory

          protected JsonXMLInputFactory createInputFactory(java.lang.Class<?> type,
                                                           JsonXML config)
                                                    throws javax.xml.bind.JAXBException

      Throws:
        `javax.xml.bind.JAXBException`

    - #### createXMLStreamReader

          protected javax.xml.stream.XMLStreamReader createXMLStreamReader(java.lang.Class<?> type,
                                                                           JsonXML config,
                                                                           java.io.Reader stream)
                                                                    throws javax.xml.stream.XMLStreamException,
                                                                           javax.xml.bind.JAXBException

      Throws:
        `javax.xml.stream.XMLStreamException`
        `javax.xml.bind.JAXBException`

    - #### createOutputFactory

          protected JsonXMLOutputFactory createOutputFactory(java.lang.Class<?> type,
                                                             JsonXML config)
                                                      throws javax.xml.bind.JAXBException

      Throws:
        `javax.xml.bind.JAXBException`

    - #### createXMLStreamWriter

          protected javax.xml.stream.XMLStreamWriter createXMLStreamWriter(java.lang.Class<?> type,
                                                                           JsonXML config,
                                                                           java.io.Writer stream)
                                                                    throws javax.xml.stream.XMLStreamException,
                                                                           javax.xml.bind.JAXBException

      Throws:
        `javax.xml.stream.XMLStreamException`
        `javax.xml.bind.JAXBException`

    - #### isBindable

          public boolean isBindable(java.lang.Class<?> type)

    - #### unmarshal

          protected <T> T unmarshal(java.lang.Class<? extends T> type,
                                    JsonXML config,
                                    javax.xml.bind.Unmarshaller unmarshaller,
                                    javax.xml.stream.XMLStreamReader reader)
                             throws javax.xml.bind.JAXBException,
                                    javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.bind.JAXBException`
        `javax.xml.stream.XMLStreamException`

    - #### marshal

          protected void marshal(java.lang.Class<?> type,
                                 JsonXML config,
                                 javax.xml.bind.Marshaller marshaller,
                                 javax.xml.stream.XMLStreamWriter writer,
                                 java.lang.Object value)
                          throws javax.xml.bind.JAXBException,
                                 javax.xml.stream.XMLStreamException

      Throws:
        `javax.xml.bind.JAXBException`
        `javax.xml.stream.XMLStreamException`

    - #### readObject

          public <T> T readObject(java.lang.Class<? extends T> type,
                                  JsonXML config,
                                  javax.xml.bind.JAXBContext context,
                                  java.io.Reader stream)
                           throws javax.xml.stream.XMLStreamException,
                                  javax.xml.bind.JAXBException

      Throws:
        `javax.xml.stream.XMLStreamException`
        `javax.xml.bind.JAXBException`

    - #### writeObject

          public void writeObject(java.lang.Class<?> type,
                                  JsonXML config,
                                  javax.xml.bind.JAXBContext context,
                                  java.io.Writer stream,
                                  java.lang.Object value)
                           throws javax.xml.stream.XMLStreamException,
                                  javax.xml.bind.JAXBException

      Throws:
        `javax.xml.stream.XMLStreamException`
        `javax.xml.bind.JAXBException`

    - #### readArray

          public <T> java.util.List<T> readArray(java.lang.Class<? extends T> type,
                                                 JsonXML config,
                                                 javax.xml.bind.JAXBContext context,
                                                 java.io.Reader stream)
                                          throws javax.xml.stream.XMLStreamException,
                                                 javax.xml.bind.JAXBException

      Throws:
        `javax.xml.stream.XMLStreamException`
        `javax.xml.bind.JAXBException`

    - #### writeArray

          public void writeArray(java.lang.Class<?> type,
                                 JsonXML config,
                                 javax.xml.bind.JAXBContext context,
                                 java.io.Writer stream,
                                 java.util.Collection<?> collection)
                          throws javax.xml.stream.XMLStreamException,
                                 javax.xml.bind.JAXBException

      Throws:
        `javax.xml.stream.XMLStreamException`
        `javax.xml.bind.JAXBException`

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