@Deprecated public class JibxMarshaller extends AbstractMarshaller implements InitializingBean
Marshaller and Unmarshaller interfaces for JiBX.
The typical usage will be to set the targetClass and optionally the
bindingName property on this bean.
IMarshallingContext,
IUnmarshallingContextlogger| Constructor and Description |
|---|
JibxMarshaller()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Deprecated.
Invoked by the containing
BeanFactory after it has set all bean properties
and satisfied BeanFactoryAware, ApplicationContextAware etc. |
XmlMappingException |
convertJibxException(org.jibx.runtime.JiBXException ex,
boolean marshalling)
Deprecated.
Convert the given
JiBXException to an appropriate exception from the
org.springframework.oxm hierarchy. |
protected org.jibx.runtime.IMarshallingContext |
createMarshallingContext()
Deprecated.
Create a new
IMarshallingContext, configured with the correct indentation. |
protected org.jibx.runtime.IUnmarshallingContext |
createUnmarshallingContext()
Deprecated.
Create a new
IUnmarshallingContext. |
protected String |
getDefaultEncoding()
Deprecated.
Determine the default encoding to use for marshalling or unmarshalling from
a byte stream, or
null if none. |
protected void |
marshalDomNode(Object graph,
Node node)
Deprecated.
Abstract template method for marshalling the given object graph to a DOM
Node. |
protected void |
marshalOutputStream(Object graph,
OutputStream outputStream)
Deprecated.
Abstract template method for marshalling the given object graph to a
OutputStream. |
protected void |
marshalSaxHandlers(Object graph,
ContentHandler contentHandler,
LexicalHandler lexicalHandler)
Deprecated.
Abstract template method for marshalling the given object graph to a SAX
ContentHandler. |
protected void |
marshalWriter(Object graph,
Writer writer)
Deprecated.
Abstract template method for marshalling the given object graph to a
Writer. |
protected void |
marshalXmlEventWriter(Object graph,
XMLEventWriter eventWriter)
Deprecated.
Abstract template method for marshalling the given object to a StAX
XMLEventWriter. |
protected void |
marshalXmlStreamWriter(Object graph,
XMLStreamWriter streamWriter)
Deprecated.
Abstract template method for marshalling the given object to a StAX
XMLStreamWriter. |
void |
setBindingName(String bindingName)
Deprecated.
Set the optional binding name for this instance.
|
void |
setDocTypeInternalSubset(String docTypeInternalSubset)
Deprecated.
Set the internal subset Id for the DTD declaration written when marshalling.
|
void |
setDocTypePublicId(String docTypePublicId)
Deprecated.
Set the public id for the DTD declaration written when marshalling.
|
void |
setDocTypeRootElementName(String docTypeRootElementName)
Deprecated.
Set the root element name for the DTD declaration written when marshalling.
|
void |
setDocTypeSystemId(String docTypeSystemId)
Deprecated.
Set the system id for the DTD declaration written when marshalling.
|
void |
setEncoding(String encoding)
Deprecated.
Set the document encoding using for marshalling.
|
void |
setIndent(int indent)
Deprecated.
Set the number of nesting indent spaces.
|
void |
setStandalone(Boolean standalone)
Deprecated.
Set the document standalone flag for marshalling.
|
void |
setTargetClass(Class<?> targetClass)
Deprecated.
Set the target class for this instance.
|
void |
setTargetPackage(String targetPackage)
Deprecated.
Set the target package for this instance.
|
boolean |
supports(Class<?> clazz)
Deprecated.
Indicate whether this marshaller can marshal instances of the supplied type.
|
protected Object |
unmarshalDomNode(Node node)
Deprecated.
Abstract template method for unmarshalling from a given DOM
Node. |
protected Object |
unmarshalInputStream(InputStream inputStream)
Deprecated.
Abstract template method for unmarshalling from a given
InputStream. |
protected Object |
unmarshalReader(Reader reader)
Deprecated.
Abstract template method for unmarshalling from a given
Reader. |
protected Object |
unmarshalSaxReader(XMLReader xmlReader,
InputSource inputSource)
Deprecated.
Abstract template method for unmarshalling using a given SAX
XMLReader
and InputSource. |
protected Object |
unmarshalXmlEventReader(XMLEventReader eventReader)
Deprecated.
Abstract template method for unmarshalling from a given Stax
XMLEventReader. |
protected Object |
unmarshalXmlStreamReader(XMLStreamReader streamReader)
Deprecated.
Abstract template method for unmarshalling from a given Stax
XMLStreamReader. |
buildDocument, createDocumentBuilder, createDocumentBuilderFactory, createXmlReader, isProcessExternalEntities, isSupportDtd, marshal, marshalDomResult, marshalSaxResult, marshalStaxResult, marshalStreamResult, setProcessExternalEntities, setSupportDtd, unmarshal, unmarshalDomSource, unmarshalSaxSource, unmarshalStaxSource, unmarshalStreamSourcepublic void setTargetClass(Class<?> targetClass)
targetPackage property is required.
If this property is set, targetPackage is ignored.
public void setTargetPackage(String targetPackage)
targetClass property is required.
If targetClass is set, this property is ignored.
public void setBindingName(String bindingName)
public void setIndent(int indent)
-1, i.e. no indentation.public void setEncoding(String encoding)
protected String getDefaultEncoding()
AbstractMarshallernull if none.
The default implementation returns null.
getDefaultEncoding in class AbstractMarshallerpublic void setStandalone(Boolean standalone)
public void setDocTypeRootElementName(String docTypeRootElementName)
null (i.e. no DTD declaration is written).
If set to a value, the system ID or public ID also need to be set.
public void setDocTypeSystemId(String docTypeSystemId)
null. Only used when the root element also has been set.
Set either this property or docTypePublicId, not both.
setDocTypeRootElementName(String)public void setDocTypePublicId(String docTypePublicId)
null. Only used when the root element also has been set.
Set either this property or docTypeSystemId, not both.
setDocTypeRootElementName(String)public void setDocTypeInternalSubset(String docTypeInternalSubset)
null. Only used when the root element also has been set.setDocTypeRootElementName(String)public void afterPropertiesSet()
throws org.jibx.runtime.JiBXException
InitializingBeanBeanFactory after it has set all bean properties
and satisfied BeanFactoryAware, ApplicationContextAware etc.
This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
afterPropertiesSet in interface InitializingBeanorg.jibx.runtime.JiBXExceptionpublic boolean supports(Class<?> clazz)
Marshallersupports in interface Marshallersupports in interface Unmarshallerclazz - the class that this marshaller is being asked if it can marshaltrue if this marshaller can indeed marshal instances of the supplied class;
false otherwiseprotected void marshalOutputStream(Object graph, OutputStream outputStream) throws XmlMappingException, IOException
AbstractMarshallerOutputStream.marshalOutputStream in class AbstractMarshallergraph - the root of the object graph to marshaloutputStream - the OutputStream to write toXmlMappingException - if the given object cannot be marshalled to the writerIOException - if an I/O exception occursprotected void marshalWriter(Object graph, Writer writer) throws XmlMappingException, IOException
AbstractMarshallerWriter.marshalWriter in class AbstractMarshallergraph - the root of the object graph to marshalwriter - the Writer to write toXmlMappingException - if the given object cannot be marshalled to the writerIOException - if an I/O exception occursprotected void marshalDomNode(Object graph, Node node) throws XmlMappingException
AbstractMarshallerNode.
In practice, node is be a Document node, a DocumentFragment node,
or a Element node. In other words, a node that accepts children.
marshalDomNode in class AbstractMarshallergraph - the root of the object graph to marshalnode - the DOM node that will contain the result treeXmlMappingException - if the given object cannot be marshalled to the DOM nodeDocument,
DocumentFragment,
Elementprotected void marshalXmlEventWriter(Object graph, XMLEventWriter eventWriter)
AbstractMarshallerXMLEventWriter.marshalXmlEventWriter in class AbstractMarshallergraph - the root of the object graph to marshaleventWriter - the XMLEventWriter to write toprotected void marshalXmlStreamWriter(Object graph, XMLStreamWriter streamWriter) throws XmlMappingException
AbstractMarshallerXMLStreamWriter.marshalXmlStreamWriter in class AbstractMarshallergraph - the root of the object graph to marshalstreamWriter - the XMLStreamWriter to write toXmlMappingException - if the given object cannot be marshalled to the DOM nodeprotected void marshalSaxHandlers(Object graph, ContentHandler contentHandler, @Nullable LexicalHandler lexicalHandler) throws XmlMappingException
AbstractMarshallerContentHandler.marshalSaxHandlers in class AbstractMarshallergraph - the root of the object graph to marshalcontentHandler - the SAX ContentHandlerlexicalHandler - the SAX2 LexicalHandler. Can be null.XmlMappingException - if the given object cannot be marshalled to the handlersprotected Object unmarshalXmlEventReader(XMLEventReader eventReader)
AbstractMarshallerXMLEventReader.unmarshalXmlEventReader in class AbstractMarshallereventReader - the XMLEventReader to read fromprotected Object unmarshalXmlStreamReader(XMLStreamReader streamReader)
AbstractMarshallerXMLStreamReader.unmarshalXmlStreamReader in class AbstractMarshallerstreamReader - the XMLStreamReader to read fromprotected Object unmarshalInputStream(InputStream inputStream) throws XmlMappingException, IOException
AbstractMarshallerInputStream.unmarshalInputStream in class AbstractMarshallerinputStream - the InputStreamStream to read fromXmlMappingException - if the given stream cannot be converted to an objectIOException - if an I/O exception occursprotected Object unmarshalReader(Reader reader) throws XmlMappingException, IOException
AbstractMarshallerReader.unmarshalReader in class AbstractMarshallerreader - the Reader to read fromXmlMappingException - if the given reader cannot be converted to an objectIOException - if an I/O exception occursprotected Object unmarshalDomNode(Node node) throws XmlMappingException
AbstractMarshallerNode.unmarshalDomNode in class AbstractMarshallernode - the DOM node that contains the objects to be unmarshalledXmlMappingException - if the given DOM node cannot be mapped to an objectprotected Object unmarshalSaxReader(XMLReader xmlReader, InputSource inputSource) throws XmlMappingException, IOException
AbstractMarshallerXMLReader
and InputSource.unmarshalSaxReader in class AbstractMarshallerxmlReader - the SAX XMLReader to parse withinputSource - the input source to parse fromXmlMappingException - if the given reader and input source cannot be converted to an objectIOException - if an I/O exception occursprotected org.jibx.runtime.IMarshallingContext createMarshallingContext()
throws org.jibx.runtime.JiBXException
IMarshallingContext, configured with the correct indentation.org.jibx.runtime.JiBXException - in case of errorsprotected org.jibx.runtime.IUnmarshallingContext createUnmarshallingContext()
throws org.jibx.runtime.JiBXException
IUnmarshallingContext.org.jibx.runtime.JiBXException - in case of errorspublic XmlMappingException convertJibxException(org.jibx.runtime.JiBXException ex, boolean marshalling)
JiBXException to an appropriate exception from the
org.springframework.oxm hierarchy.
A boolean flag is used to indicate whether this exception occurs during marshalling or unmarshalling, since JiBX itself does not make this distinction in its exception hierarchy.
ex - JiBXException that occurredmarshalling - indicates whether the exception occurs during marshalling (true),
or unmarshalling (false)XmlMappingException