org.apache.axiom.om.ds
Class AbstractPullOMDataSource

java.lang.Object
  extended by org.apache.axiom.om.ds.AbstractOMDataSource
      extended by org.apache.axiom.om.ds.AbstractPullOMDataSource
All Implemented Interfaces:
OMDataSource, OMDataSourceExt
Direct Known Subclasses:
WrappedTextNodeOMDataSource

public abstract class AbstractPullOMDataSource
extends AbstractOMDataSource

Base class for OMDataSourceExt implementations that can easily produce the content as an XMLStreamReader and that don't implement any kind of optimization for serializing the content.


Field Summary
 
Fields inherited from interface org.apache.axiom.om.OMDataSourceExt
LOSSY_PREFIX
 
Constructor Summary
AbstractPullOMDataSource()
           
 
Method Summary
 boolean isDestructiveWrite()
          Returns true if writing the backing object is destructive.
 void serialize(XMLStreamWriter xmlWriter)
          Serializes element data directly to StAX writer.
 
Methods inherited from class org.apache.axiom.om.ds.AbstractOMDataSource
close, copy, getObject, getProperty, getXMLBytes, getXMLInputStream, hasProperty, serialize, serialize, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.axiom.om.OMDataSourceExt
isDestructiveRead
 
Methods inherited from interface org.apache.axiom.om.OMDataSource
getReader
 

Constructor Detail

AbstractPullOMDataSource

public AbstractPullOMDataSource()
Method Detail

isDestructiveWrite

public final boolean isDestructiveWrite()
Description copied from interface: OMDataSourceExt
Returns true if writing the backing object is destructive. An example of an object with a destructive write is an InputStream. The owning OMSourcedElement uses this information to detemine if OM tree expansion is needed when writing the OMDataSourceExt.

Returns:
boolean

serialize

public final void serialize(XMLStreamWriter xmlWriter)
                     throws XMLStreamException
Description copied from interface: OMDataSource
Serializes element data directly to StAX writer.

The implementation of this method must satisfy the following requirements:

On the other hand, the caller of this method (typically an OMSourcedElement instance) must ensure that the following requirements are satisfied:

It is assumed that this method consumes the content (i.e. destroys the backing object) unless the data source also implements OMDataSourceExt and OMDataSourceExt.isDestructiveWrite() returns false.

Parameters:
xmlWriter - destination writer
Throws:
XMLStreamException


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.