org.plasma.sdo.xml
Class StreamMarshaller
java.lang.Object
org.plasma.sdo.xml.XMLProcessor
org.plasma.sdo.xml.Marshaller
org.plasma.sdo.xml.StreamMarshaller
public class StreamMarshaller
- extends Marshaller
A Streaming API for XML (StAX) based XML marshaler which converts/writes
an SDO data graph to various supplied (stream-based) XML output sources. As the data graph
is traversed to generate output, containment and non containment reference
(property) associations are detected and handled such that even though
multiple references to the same data object are encountered, (where possible) no duplicate
XML data is written to the result. This not only reduces the size of the XML result, but
provides enough information related to containment and non containment references
such that the original data graph can be coalesced and re-constituted from the XML
back into a fully operational state.
Of primary concern with regard to handling containment and non containment
references is of course that the XML result be valid in relation to the associated
XML Schema. XML Schema Instance (XSI) mechanisms are used to accommodate multiple XML
representations of the same (SDO) Type under both containment and non containment
scenarios.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StreamMarshaller
public StreamMarshaller(XMLDocument document)
- Constructor.
- Parameters:
document - the document containing the root data object
and other XML related valuesoptions - the XML marshaling options- See Also:
XMLDocument
StreamMarshaller
public StreamMarshaller(XMLDocument document,
XMLOptions options)
- Constructor.
- Parameters:
document - the document containing the root data object
and other XML related valuesoptions - the XML marshaling options- See Also:
XMLDocument,
XMLOptions
marshal
public void marshal(OutputStream stream)
throws XMLStreamException,
MarshallerException
- Throws:
XMLStreamException
MarshallerException
marshal
public void marshal(Writer outputWriter)
throws XMLStreamException,
MarshallerException
- Throws:
XMLStreamException
MarshallerException
marshal
public void marshal(Result outputResult)
throws XMLStreamException,
MarshallerException
- Throws:
XMLStreamException
MarshallerException
fromObject
protected String fromObject(Type sourceType,
Object value)
- Overrides:
fromObject in class Marshaller
Copyright © 2014. All rights reserved.