Class JsonXMLBinder
- java.lang.Object
-
- org.apache.synapse.commons.staxon.core.json.jaxb.JsonXMLBinder
-
public class JsonXMLBinder extends Object
Read/write instances of JAXB-annotated classes from/to JSON.
-
-
Constructor Summary
Constructors Modifier Constructor Description JsonXMLBinder()
protected
JsonXMLBinder(boolean writeDocumentArray)
protected
JsonXMLBinder(JsonXMLRootProvider rootProvider, boolean writeDocumentArray)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JsonXMLInputFactory
createInputFactory(Class<?> type, JsonXML config)
protected JsonXMLOutputFactory
createOutputFactory(Class<?> type, JsonXML config)
protected XMLStreamReader
createXMLStreamReader(Class<?> type, JsonXML config, Reader stream)
protected XMLStreamWriter
createXMLStreamWriter(Class<?> type, JsonXML config, Writer stream)
boolean
isBindable(Class<?> type)
protected void
marshal(Class<?> type, JsonXML config, Marshaller marshaller, XMLStreamWriter writer, Object value)
<T> List<T>
readArray(Class<? extends T> type, JsonXML config, JAXBContext context, Reader stream)
<T> T
readObject(Class<? extends T> type, JsonXML config, JAXBContext context, Reader stream)
protected <T> T
unmarshal(Class<? extends T> type, JsonXML config, Unmarshaller unmarshaller, XMLStreamReader reader)
void
writeArray(Class<?> type, JsonXML config, JAXBContext context, Writer stream, Collection<?> collection)
void
writeObject(Class<?> type, JsonXML config, JAXBContext context, Writer stream, Object value)
-
-
-
Constructor Detail
-
JsonXMLBinder
public JsonXMLBinder()
-
JsonXMLBinder
protected JsonXMLBinder(boolean writeDocumentArray)
-
JsonXMLBinder
protected JsonXMLBinder(JsonXMLRootProvider rootProvider, boolean writeDocumentArray)
-
-
Method Detail
-
createInputFactory
protected JsonXMLInputFactory createInputFactory(Class<?> type, JsonXML config) throws JAXBException
- Throws:
JAXBException
-
createXMLStreamReader
protected XMLStreamReader createXMLStreamReader(Class<?> type, JsonXML config, Reader stream) throws XMLStreamException, JAXBException
- Throws:
XMLStreamException
JAXBException
-
createOutputFactory
protected JsonXMLOutputFactory createOutputFactory(Class<?> type, JsonXML config) throws JAXBException
- Throws:
JAXBException
-
createXMLStreamWriter
protected XMLStreamWriter createXMLStreamWriter(Class<?> type, JsonXML config, Writer stream) throws XMLStreamException, JAXBException
- Throws:
XMLStreamException
JAXBException
-
isBindable
public boolean isBindable(Class<?> type)
-
unmarshal
protected <T> T unmarshal(Class<? extends T> type, JsonXML config, Unmarshaller unmarshaller, XMLStreamReader reader) throws JAXBException, XMLStreamException
- Throws:
JAXBException
XMLStreamException
-
marshal
protected void marshal(Class<?> type, JsonXML config, Marshaller marshaller, XMLStreamWriter writer, Object value) throws JAXBException, XMLStreamException
- Throws:
JAXBException
XMLStreamException
-
readObject
public <T> T readObject(Class<? extends T> type, JsonXML config, JAXBContext context, Reader stream) throws XMLStreamException, JAXBException
- Throws:
XMLStreamException
JAXBException
-
writeObject
public void writeObject(Class<?> type, JsonXML config, JAXBContext context, Writer stream, Object value) throws XMLStreamException, JAXBException
- Throws:
XMLStreamException
JAXBException
-
readArray
public <T> List<T> readArray(Class<? extends T> type, JsonXML config, JAXBContext context, Reader stream) throws XMLStreamException, JAXBException
- Throws:
XMLStreamException
JAXBException
-
writeArray
public void writeArray(Class<?> type, JsonXML config, JAXBContext context, Writer stream, Collection<?> collection) throws XMLStreamException, JAXBException
- Throws:
XMLStreamException
JAXBException
-
-