javax.xml.bind.util
public class JAXBSource extends SAXSource
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);
Since: JAXB1.0
Constructor Summary | |
---|---|
JAXBSource(JAXBContext pContext, Object pObject) Creates a new instance of JAXBSource. | |
JAXBSource(Marshaller pMarshaller, Object pObject) Creates a new instance of JAXBSource. |
Creates a new instance of JAXBSource. The given {@link javax.xml.bind.JAXBContext} will be used to construct a {@link javax.xml.bind.Marshaller} and invoke the constructor {@link #JAXBSource(javax.xml.bind.Marshaller, Object)}.
Creates a new instance of JAXBSource.