java.lang.Objectjavax.xml.transform.sax.SAXSource
javax.xml.bind.util.JAXBSource
All Implemented Interfaces:
Source
This utility class is useful to combine JAXB with other Java/XML technologies.
The following example shows how to use JAXB to marshal a document for transformation by XSLT.
MyObject o = // get JAXB content tree
// jaxbContext is a JAXBContext object from which 'o' is created.
JAXBSource source = new JAXBSource( jaxbContext, o );
// set up XSLT transformation
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer(new StreamSource("test.xsl"));
// run transformation
t.transform(source,new StreamResult(System.out));
The fact that JAXBSource derives from SAXSource is an implementation detail. Thus in general applications are strongly discouraged from accessing methods defined on SAXSource. In particular, the setXMLReader and setInputSource methods shall never be called. The XMLReader object obtained by the getXMLReader method shall be used only for parsing the InputSource object returned by the getInputSource method.
Similarly the InputSource object obtained by the getInputSource method shall be used only for being parsed by the XMLReader object returned by the getXMLReader.
Kohsuke - Kawaguchi (kohsuke.kawaguchi@sun.com)| Fields inherited from javax.xml.transform.sax.SAXSource: |
|---|
| FEATURE |
| Constructor: |
|---|
|
|
| Methods from javax.xml.transform.sax.SAXSource: |
|---|
| getInputSource, getSystemId, getXMLReader, setInputSource, setSystemId, setXMLReader, sourceToInputSource |
| Methods from java.lang.Object: |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |