Package org.springframework.oxm.support
Class MarshallingSource
java.lang.Object
javax.xml.transform.sax.SAXSource
org.springframework.oxm.support.MarshallingSource
- All Implemented Interfaces:
Source
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.
- Since:
- 3.0
- Author:
- Arjen Poutsma
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionMarshallingSource(Marshaller marshaller, Object content) Create a newMarshallingSourcewith the given marshaller and content. -
Method Summary
Modifier and TypeMethodDescriptionReturn the object to be marshalled.Return theMarshallerused by thisMarshallingSource.voidsetInputSource(InputSource inputSource) Throws aUnsupportedOperationException.voidsetXMLReader(XMLReader reader) Throws aUnsupportedOperationException.Methods inherited from class javax.xml.transform.sax.SAXSource
getInputSource, getSystemId, getXMLReader, isEmpty, setSystemId, sourceToInputSource
-
Constructor Details
-
MarshallingSource
Create a newMarshallingSourcewith the given marshaller and content.- Parameters:
marshaller- the marshaller to usecontent- the object to be marshalled
-
-
Method Details
-
getMarshaller
Return theMarshallerused by thisMarshallingSource. -
getContent
Return the object to be marshalled. -
setInputSource
Throws aUnsupportedOperationException.- Overrides:
setInputSourcein classSAXSource
-
setXMLReader
Throws aUnsupportedOperationException.- Overrides:
setXMLReaderin classSAXSource
-