org.apache.tuscany.sdo.helper
Class XMLStreamHelperImpl

java.lang.Object
  extended by org.apache.tuscany.sdo.helper.XMLStreamHelperImpl
All Implemented Interfaces:
XMLStreamHelper

public class XMLStreamHelperImpl
extends java.lang.Object
implements XMLStreamHelper


Constructor Summary
XMLStreamHelperImpl(commonj.sdo.helper.TypeHelper typeHelper)
           
 
Method Summary
 javax.xml.stream.XMLStreamReader createXMLStreamReader(commonj.sdo.DataObject dataObject)
          Creates and returns a XMLStreamReader that can be used to read a DataObject as a XML event stream.
 javax.xml.stream.XMLStreamReader createXMLStreamReader(commonj.sdo.helper.XMLDocument document)
          Creates and returns a XMLStreamReader that can be used to read an XMLDocument as a XML event stream.
 commonj.sdo.helper.XMLDocument load(javax.xml.stream.XMLStreamReader reader)
          Creates and returns an XMLDocument from an XML input stream.
protected  commonj.sdo.helper.XMLDocument loadDocument(javax.xml.stream.XMLStreamReader reader)
           
 commonj.sdo.DataObject loadObject(javax.xml.stream.XMLStreamReader reader)
          Create a DataObject from an element in a XML stream.
 void save(commonj.sdo.helper.XMLDocument document, javax.xml.stream.XMLStreamWriter writer)
          Save a XMLDocument to an XML stream.
 void saveObject(commonj.sdo.DataObject sdo, javax.xml.stream.XMLStreamWriter writer)
          Save a DataObject to an XML stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLStreamHelperImpl

public XMLStreamHelperImpl(commonj.sdo.helper.TypeHelper typeHelper)
Method Detail

load

public commonj.sdo.helper.XMLDocument load(javax.xml.stream.XMLStreamReader reader)
                                    throws javax.xml.stream.XMLStreamException,
                                           java.lang.IllegalStateException
Description copied from interface: XMLStreamHelper
Creates and returns an XMLDocument from an XML input stream. The reader must be positioned on a START_DOCUMENT event.

Specified by:
load in interface XMLStreamHelper
Parameters:
reader - the stream to read
Returns:
an XMLDocument created from the stream
Throws:
javax.xml.stream.XMLStreamException - if there was a problem reading the stream
java.lang.IllegalStateException - if the reader is not positioned on a START_DOCUMENT event

save

public void save(commonj.sdo.helper.XMLDocument document,
                 javax.xml.stream.XMLStreamWriter writer)
          throws javax.xml.stream.XMLStreamException
Description copied from interface: XMLStreamHelper
Save a XMLDocument to an XML stream.

Specified by:
save in interface XMLStreamHelper
Parameters:
document - the document to be written
writer - the stream to write to
Throws:
javax.xml.stream.XMLStreamException - if there was a problem writing to the stream

createXMLStreamReader

public javax.xml.stream.XMLStreamReader createXMLStreamReader(commonj.sdo.helper.XMLDocument document)
                                                       throws javax.xml.stream.XMLStreamException
Description copied from interface: XMLStreamHelper
Creates and returns a XMLStreamReader that can be used to read an XMLDocument as a XML event stream. The reader will be positioned on a START_DOCUMENT event.

Specified by:
createXMLStreamReader in interface XMLStreamHelper
Parameters:
document - the XMLDocument to be read
Returns:
an XMLStreamReader that can be used to read the document
Throws:
javax.xml.stream.XMLStreamException

loadObject

public commonj.sdo.DataObject loadObject(javax.xml.stream.XMLStreamReader reader)
                                  throws javax.xml.stream.XMLStreamException,
                                         java.lang.IllegalStateException
Description copied from interface: XMLStreamHelper
Create a DataObject from an element in a XML stream. The reader must be positioned on a START_ELEMENT event.

Specified by:
loadObject in interface XMLStreamHelper
Parameters:
reader - the stream to read
Returns:
a DataObject created from the element in the stream
Throws:
javax.xml.stream.XMLStreamException - if there was a problem reading the stream
java.lang.IllegalStateException - if the reader is not positioned on a START_ELEMENT event

saveObject

public void saveObject(commonj.sdo.DataObject sdo,
                       javax.xml.stream.XMLStreamWriter writer)
                throws javax.xml.stream.XMLStreamException
Description copied from interface: XMLStreamHelper
Save a DataObject to an XML stream.

Specified by:
saveObject in interface XMLStreamHelper
Parameters:
sdo - the DataObject to be written
writer - the stream to write to
Throws:
javax.xml.stream.XMLStreamException - if there was a problem writing to the stream

createXMLStreamReader

public javax.xml.stream.XMLStreamReader createXMLStreamReader(commonj.sdo.DataObject dataObject)
Description copied from interface: XMLStreamHelper
Creates and returns a XMLStreamReader that can be used to read a DataObject as a XML event stream. The reader will be positioned on a START_ELEMENT event.

Specified by:
createXMLStreamReader in interface XMLStreamHelper
Parameters:
dataObject - the DataObject to be read
Returns:
an XMLStreamReader that can be used to read the DataObject

loadDocument

protected commonj.sdo.helper.XMLDocument loadDocument(javax.xml.stream.XMLStreamReader reader)
                                               throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException


Copyright © 2006 Apache Software Foundation. All Rights Reserved.