public class JAXBSource
extends javax.xml.transform.sax.SAXSource
SAXSource
, you should
use this class. In particular, you must not use the
methods
SAXSource.setInputSource(InputSource)
,
or
SAXSource.setXMLReader(XMLReader)
on an instance of JAXBSource
.JAXBSource
can be obtained as follows:
javax.xml.bind.JAXBContext context; javax.xml.bind.Element object; java.io.StringWriter sw = new java.io.StringWriter(); context.createMarshaller().marshal(object, sw); org.xml.sax.InputSource isource = new org.xml.sax.InputSource(new java.io.StringReader(sw.toString())); javax.xml.transform.sax.SAXSource source = new javax.xml.transform.sax.SAXSource(isource);
Constructor and Description |
---|
JAXBSource(JAXBContext pContext,
java.lang.Object pObject)
Creates a new instance of JAXBSource.
|
JAXBSource(Marshaller pMarshaller,
java.lang.Object pObject)
Creates a new instance of JAXBSource.
|
public JAXBSource(JAXBContext pContext, java.lang.Object pObject) throws JAXBException
Creates a new instance of JAXBSource. The given
JAXBContext
will be used to
construct a Marshaller
and
invoke the constructor
JAXBSource(javax.xml.bind.Marshaller, Object)
.
JAXBException
public JAXBSource(Marshaller pMarshaller, java.lang.Object pObject) throws JAXBException
Creates a new instance of JAXBSource.
JAXBException