Package org.springframework.oxm.support
Class MarshallingSource
- java.lang.Object
- javax.xml.transform.sax.SAXSource
- org.springframework.oxm.support.MarshallingSource
- All Implemented Interfaces:
Source
public class MarshallingSource extends SAXSource
Source
implementation that uses aMarshaller
.Can be constructed with aMarshaller
and an object to be marshalled.Even though
MarshallingSource
extends fromSAXSource
, calling the methods ofSAXSource
is not supported. In general, the only supported operation on this class is to use theXMLReader
obtained viaSAXSource.getXMLReader()
to parse the input source obtained viaSAXSource.getInputSource()
. CallingsetXMLReader(XMLReader)
orsetInputSource(InputSource)
will result inUnsupportedOperationException
s.- Since:
- 3.0
- Author:
- Arjen Poutsma
- See Also:
Transformer
Constructor Summary
Constructors Constructor Description MarshallingSource(Marshaller marshaller, Object content)
Create a newMarshallingSource
with the given marshaller and content.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getContent()
Return the object to be marshalled.Marshaller
getMarshaller()
Return theMarshaller
used by thisMarshallingSource
.void
setInputSource(InputSource inputSource)
Throws aUnsupportedOperationException
.void
setXMLReader(XMLReader reader)
Throws aUnsupportedOperationException
.Methods inherited from class javax.xml.transform.sax.SAXSource
getInputSource, getSystemId, getXMLReader, isEmpty, setSystemId, sourceToInputSource
Constructor Detail
MarshallingSource
public MarshallingSource(Marshaller marshaller, Object content)
Create a newMarshallingSource
with the given marshaller and content.- Parameters:
marshaller
- the marshaller to usecontent
- the object to be marshalled
Method Detail
getMarshaller
public Marshaller getMarshaller()
Return theMarshaller
used by thisMarshallingSource
.
getContent
public Object getContent()
Return the object to be marshalled.
setInputSource
public void setInputSource(InputSource inputSource)
Throws aUnsupportedOperationException
.- Overrides:
setInputSource
in classSAXSource
setXMLReader
public void setXMLReader(XMLReader reader)
Throws aUnsupportedOperationException
.- Overrides:
setXMLReader
in classSAXSource