public class JAXBDataSource extends ReaderWriterDataSource
ReaderWriterDataSource
implementation to provide
Marshaller
marshalling and Unmarshaller
unmarshalling
services.CHARSET
APPLICATION_OCTET_STREAM, APPLICATION_XML, CONTENT_TYPE, TEXT_HTML, TEXT_PLAIN
Constructor and Description |
---|
JAXBDataSource()
No-argument constructor.
|
JAXBDataSource(Object object)
Construct and marshal the argument
Object . |
Modifier and Type | Method and Description |
---|---|
void |
marshal(JAXBContext context,
Object object)
Marshal the argument
Object . |
void |
marshal(Object object)
Marshal the argument
Object . |
<T> T |
unmarshal(Class<? extends T> type)
Unmarshal the argument
Object . |
<T> T |
unmarshal(JAXBContext context,
Class<? extends T> type)
Unmarshal the argument
Object . |
getBufferedReader, getCharset, getPrintStream, getPrintWriter, getReader, getWriter, nameOf, toString, writeTo
getContentType, getDataSource, getInputStream, getName, getOutputStream, setContentType, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clear, getInputStream, getOutputStream, length, wrap, wrap, writeTo
public JAXBDataSource(Object object)
Object
.object
- The Object
to marshal.public JAXBDataSource()
public void marshal(Object object) throws IOException, JAXBException
Object
.object
- The Object
to marshal.IOException
- If an I/O exception occurs.JAXBException
- If a JAXB exception occurs.public void marshal(JAXBContext context, Object object) throws IOException, JAXBException
Object
.context
- The JAXBContext
.object
- The Object
to marshal.IOException
- If an I/O exception occurs.JAXBException
- If a JAXB exception occurs.public <T> T unmarshal(Class<? extends T> type) throws IOException, JAXBException
Object
.T
- The target type.type
- The target Class
.Object
.IOException
- If an I/O exception occurs.JAXBException
- If a JAXB exception occurs.public <T> T unmarshal(JAXBContext context, Class<? extends T> type) throws IOException, JAXBException
Object
.T
- The target type.context
- The JAXBContext
.type
- The target Class
.Object
.IOException
- If an I/O exception occurs.JAXBException
- If a JAXB exception occurs.Copyright © 2015–2020 Allen D. Ball. All rights reserved.