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

# Class JsonXMLMapper<T>

java.lang.Object
org.apache.synapse.commons.staxon.core.json.jaxb.JsonXMLMapper<T>

public class JsonXMLMapper<T> extends Object
Read/write instances of JAXB-annotated classes from/to JSON.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JsonXMLMapper(Class<T> type)`
  `JsonXMLMapper(Class<T> type, JsonXML config)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected JsonXMLBinder`
  `createBinder(JsonXML config)`
  `protected jakarta.xml.bind.JAXBContext`
  `createContext(JsonXML config)`
  `List<T>`
  `readArray(InputStream input)`
  `List<T>`
  `readArray(Reader reader)`
  `T`
  `readObject(InputStream input)`
  `T`
  `readObject(Reader reader)`
  `void`
  `writeArray(OutputStream output, Collection<T> collection)`
  `void`
  `writeArray(Writer writer, Collection<T> collection)`
  `void`
  `writeObject(OutputStream output, T value)`
  `void`
  `writeObject(Writer writer, T value)`

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

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

- ## Constructor Details

  - ### JsonXMLMapper

    public JsonXMLMapper(Class<T> type) throws jakarta.xml.bind.JAXBException
    Throws:
      `jakarta.xml.bind.JAXBException`

  - ### JsonXMLMapper

    public JsonXMLMapper(Class<T> type, JsonXML config) throws jakarta.xml.bind.JAXBException
    Throws:
      `jakarta.xml.bind.JAXBException`

- ## Method Details

  - ### createBinder

    protected JsonXMLBinder createBinder(JsonXML config)

  - ### createContext

    protected jakarta.xml.bind.JAXBContext createContext(JsonXML config) throws jakarta.xml.bind.JAXBException
    Throws:
      `jakarta.xml.bind.JAXBException`

  - ### readObject

    public T readObject(Reader reader) throws jakarta.xml.bind.JAXBException, XMLStreamException
    Throws:
      `jakarta.xml.bind.JAXBException`
      `XMLStreamException`

  - ### readObject

    public T readObject(InputStream input) throws jakarta.xml.bind.JAXBException, XMLStreamException
    Throws:
      `jakarta.xml.bind.JAXBException`
      `XMLStreamException`

  - ### writeObject

    public void writeObject(Writer writer, T value) throws jakarta.xml.bind.JAXBException, XMLStreamException
    Throws:
      `jakarta.xml.bind.JAXBException`
      `XMLStreamException`

  - ### writeObject

    public void writeObject(OutputStream output, T value) throws jakarta.xml.bind.JAXBException, XMLStreamException
    Throws:
      `jakarta.xml.bind.JAXBException`
      `XMLStreamException`

  - ### readArray

    public List<T> readArray(Reader reader) throws jakarta.xml.bind.JAXBException, XMLStreamException
    Throws:
      `jakarta.xml.bind.JAXBException`
      `XMLStreamException`

  - ### readArray

    public List<T> readArray(InputStream input) throws jakarta.xml.bind.JAXBException, XMLStreamException
    Throws:
      `jakarta.xml.bind.JAXBException`
      `XMLStreamException`

  - ### writeArray

    public void writeArray(Writer writer, Collection<T> collection) throws jakarta.xml.bind.JAXBException, XMLStreamException
    Throws:
      `jakarta.xml.bind.JAXBException`
      `XMLStreamException`

  - ### writeArray

    public void writeArray(OutputStream output, Collection<T> collection) throws jakarta.xml.bind.JAXBException, XMLStreamException
    Throws:
      `jakarta.xml.bind.JAXBException`
      `XMLStreamException`