public class MarshallingSource
extends javax.xml.transform.sax.SAXSource
Source
implementation that uses a Marshaller
.Can be constructed with a
Marshaller
and an object to be marshalled.
Even though MarshallingSource
extends from SAXSource
, calling the methods of
SAXSource
is not supported. In general, the only supported operation on this class is
to use the XMLReader
obtained via SAXSource.getXMLReader()
to parse the input source obtained via SAXSource.getInputSource()
. Calling setXMLReader(XMLReader)
or setInputSource(InputSource)
will result in
UnsupportedOperationException
s.
Transformer
Constructor and Description |
---|
MarshallingSource(Marshaller marshaller,
java.lang.Object content)
Create a new
MarshallingSource with the given marshaller and content. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getContent()
Return the object to be marshalled.
|
Marshaller |
getMarshaller()
Return the
Marshaller used by this MarshallingSource . |
void |
setInputSource(org.xml.sax.InputSource inputSource)
Throws a
UnsupportedOperationException . |
void |
setXMLReader(org.xml.sax.XMLReader reader)
Throws a
UnsupportedOperationException . |
public MarshallingSource(Marshaller marshaller, java.lang.Object content)
MarshallingSource
with the given marshaller and content.marshaller
- the marshaller to usecontent
- the object to be marshalledpublic Marshaller getMarshaller()
Marshaller
used by this MarshallingSource
.public java.lang.Object getContent()
public void setInputSource(org.xml.sax.InputSource inputSource)
UnsupportedOperationException
.setInputSource
in class javax.xml.transform.sax.SAXSource
public void setXMLReader(org.xml.sax.XMLReader reader)
UnsupportedOperationException
.setXMLReader
in class javax.xml.transform.sax.SAXSource