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
Sourceimplementation that uses aMarshaller.Can be constructed with aMarshallerand an object to be marshalled.Even though
MarshallingSourceextends fromSAXSource, calling the methods ofSAXSourceis not supported. In general, the only supported operation on this class is to use theXMLReaderobtained viaSAXSource.getXMLReader()to parse the input source obtained viaSAXSource.getInputSource(). CallingsetXMLReader(XMLReader)orsetInputSource(InputSource)will result inUnsupportedOperationExceptions.- Since:
- 3.0
- Author:
- Arjen Poutsma
- See Also:
Transformer
Constructor Summary
Constructors Constructor Description MarshallingSource(Marshaller marshaller, Object content)Create a newMarshallingSourcewith the given marshaller and content.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectgetContent()Return the object to be marshalled.MarshallergetMarshaller()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 Detail
MarshallingSource
public MarshallingSource(Marshaller marshaller, Object content)
Create a newMarshallingSourcewith the given marshaller and content.- Parameters:
marshaller- the marshaller to usecontent- the object to be marshalled
Method Detail
getMarshaller
public Marshaller getMarshaller()
Return theMarshallerused by thisMarshallingSource.
getContent
public Object getContent()
Return the object to be marshalled.
setInputSource
public void setInputSource(InputSource inputSource)
Throws aUnsupportedOperationException.- Overrides:
setInputSourcein classSAXSource
setXMLReader
public void setXMLReader(XMLReader reader)
Throws aUnsupportedOperationException.- Overrides:
setXMLReaderin classSAXSource