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()protectedJsonXMLBinder(boolean writeDocumentArray)protectedJsonXMLBinder(JsonXMLRootProvider rootProvider, boolean writeDocumentArray)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JsonXMLInputFactorycreateInputFactory(Class<?> type, JsonXML config)protected JsonXMLOutputFactorycreateOutputFactory(Class<?> type, JsonXML config)protected XMLStreamReadercreateXMLStreamReader(Class<?> type, JsonXML config, Reader stream)protected XMLStreamWritercreateXMLStreamWriter(Class<?> type, JsonXML config, Writer stream)booleanisBindable(Class<?> type)protected voidmarshal(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> TreadObject(Class<? extends T> type, JsonXML config, JAXBContext context, Reader stream)protected <T> Tunmarshal(Class<? extends T> type, JsonXML config, Unmarshaller unmarshaller, XMLStreamReader reader)voidwriteArray(Class<?> type, JsonXML config, JAXBContext context, Writer stream, Collection<?> collection)voidwriteObject(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:
XMLStreamExceptionJAXBException
-
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:
XMLStreamExceptionJAXBException
-
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:
JAXBExceptionXMLStreamException
-
marshal
protected void marshal(Class<?> type, JsonXML config, Marshaller marshaller, XMLStreamWriter writer, Object value) throws JAXBException, XMLStreamException
- Throws:
JAXBExceptionXMLStreamException
-
readObject
public <T> T readObject(Class<? extends T> type, JsonXML config, JAXBContext context, Reader stream) throws XMLStreamException, JAXBException
- Throws:
XMLStreamExceptionJAXBException
-
writeObject
public void writeObject(Class<?> type, JsonXML config, JAXBContext context, Writer stream, Object value) throws XMLStreamException, JAXBException
- Throws:
XMLStreamExceptionJAXBException
-
readArray
public <T> List<T> readArray(Class<? extends T> type, JsonXML config, JAXBContext context, Reader stream) throws XMLStreamException, JAXBException
- Throws:
XMLStreamExceptionJAXBException
-
writeArray
public void writeArray(Class<?> type, JsonXML config, JAXBContext context, Writer stream, Collection<?> collection) throws XMLStreamException, JAXBException
- Throws:
XMLStreamExceptionJAXBException
-
-