public class MarshallingSource extends 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
UnsupportedOperationExceptions.
Transformer| 构造器和说明 |
|---|
MarshallingSource(Marshaller marshaller,
Object content)
Create a new
MarshallingSource with the given marshaller and content. |
| 限定符和类型 | 方法和说明 |
|---|---|
Object |
getContent()
Return the object to be marshalled.
|
Marshaller |
getMarshaller()
Return the
Marshaller used by this MarshallingSource. |
void |
setInputSource(InputSource inputSource)
Throws a
UnsupportedOperationException. |
void |
setXMLReader(XMLReader reader)
Throws a
UnsupportedOperationException. |
getInputSource, getSystemId, getXMLReader, setSystemId, sourceToInputSourcepublic MarshallingSource(Marshaller marshaller, 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 Object getContent()
public void setInputSource(InputSource inputSource)
UnsupportedOperationException.setInputSource 在类中 SAXSourcepublic void setXMLReader(XMLReader reader)
UnsupportedOperationException.setXMLReader 在类中 SAXSource