javax.xml.bind.util
Class JAXBSource
SAXSource
javax.xml.bind.util.JAXBSource
public class JAXBSource
extends SAXSource
This utility class allows to use a JAXB object as the
source of a stylesheet transformation.
If you depend on any methods from
javax.xml.transform.sax.SAXSource
, you should
use this class. In particular, you must not use the
methods
javax.xml.transform.sax.SAXSource.setInputSource(InputSource)
,
or
javax.xml.transform.sax.SAXSource.setXMLReader(XMLReader)
on an instance of
JAXBSource
.
If you depend on these methods, a replacement for the
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);
JAXBSource
public JAXBSource(Marshaller pMarshaller,
Object pObject)
throws JAXBException
Creates a new instance of JAXBSource.