Class JsonXMLBinder
java.lang.Object
org.apache.synapse.commons.staxon.core.json.jaxb.JsonXMLBinder
Read/write instances of JAXB-annotated classes from/to JSON.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJsonXMLBinder(boolean writeDocumentArray) protectedJsonXMLBinder(JsonXMLRootProvider rootProvider, boolean writeDocumentArray) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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, jakarta.xml.bind.Marshaller marshaller, XMLStreamWriter writer, Object value) <T> List<T> readArray(Class<? extends T> type, JsonXML config, jakarta.xml.bind.JAXBContext context, Reader stream) <T> TreadObject(Class<? extends T> type, JsonXML config, jakarta.xml.bind.JAXBContext context, Reader stream) protected <T> Tunmarshal(Class<? extends T> type, JsonXML config, jakarta.xml.bind.Unmarshaller unmarshaller, XMLStreamReader reader) voidwriteArray(Class<?> type, JsonXML config, jakarta.xml.bind.JAXBContext context, Writer stream, Collection<?> collection) voidwriteObject(Class<?> type, JsonXML config, jakarta.xml.bind.JAXBContext context, Writer stream, Object value)
-
Constructor Details
-
JsonXMLBinder
public JsonXMLBinder() -
JsonXMLBinder
protected JsonXMLBinder(boolean writeDocumentArray) -
JsonXMLBinder
-
-
Method Details
-
createInputFactory
protected JsonXMLInputFactory createInputFactory(Class<?> type, JsonXML config) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-
createXMLStreamReader
protected XMLStreamReader createXMLStreamReader(Class<?> type, JsonXML config, Reader stream) throws XMLStreamException, jakarta.xml.bind.JAXBException - Throws:
XMLStreamExceptionjakarta.xml.bind.JAXBException
-
createOutputFactory
protected JsonXMLOutputFactory createOutputFactory(Class<?> type, JsonXML config) throws jakarta.xml.bind.JAXBException - Throws:
jakarta.xml.bind.JAXBException
-
createXMLStreamWriter
protected XMLStreamWriter createXMLStreamWriter(Class<?> type, JsonXML config, Writer stream) throws XMLStreamException, jakarta.xml.bind.JAXBException - Throws:
XMLStreamExceptionjakarta.xml.bind.JAXBException
-
isBindable
-
unmarshal
protected <T> T unmarshal(Class<? extends T> type, JsonXML config, jakarta.xml.bind.Unmarshaller unmarshaller, XMLStreamReader reader) throws jakarta.xml.bind.JAXBException, XMLStreamException - Throws:
jakarta.xml.bind.JAXBExceptionXMLStreamException
-
marshal
protected void marshal(Class<?> type, JsonXML config, jakarta.xml.bind.Marshaller marshaller, XMLStreamWriter writer, Object value) throws jakarta.xml.bind.JAXBException, XMLStreamException - Throws:
jakarta.xml.bind.JAXBExceptionXMLStreamException
-
readObject
public <T> T readObject(Class<? extends T> type, JsonXML config, jakarta.xml.bind.JAXBContext context, Reader stream) throws XMLStreamException, jakarta.xml.bind.JAXBException - Throws:
XMLStreamExceptionjakarta.xml.bind.JAXBException
-
writeObject
public void writeObject(Class<?> type, JsonXML config, jakarta.xml.bind.JAXBContext context, Writer stream, Object value) throws XMLStreamException, jakarta.xml.bind.JAXBException - Throws:
XMLStreamExceptionjakarta.xml.bind.JAXBException
-
readArray
public <T> List<T> readArray(Class<? extends T> type, JsonXML config, jakarta.xml.bind.JAXBContext context, Reader stream) throws XMLStreamException, jakarta.xml.bind.JAXBException - Throws:
XMLStreamExceptionjakarta.xml.bind.JAXBException
-
writeArray
public void writeArray(Class<?> type, JsonXML config, jakarta.xml.bind.JAXBContext context, Writer stream, Collection<?> collection) throws XMLStreamException, jakarta.xml.bind.JAXBException - Throws:
XMLStreamExceptionjakarta.xml.bind.JAXBException
-