org.apache.axis2.databinding
Class ADBHelperDataSource

java.lang.Object
  extended by org.apache.axis2.databinding.ADBHelperDataSource
All Implemented Interfaces:
org.apache.axiom.om.OMDataSource, org.apache.axiom.om.OMDataSourceExt

public abstract class ADBHelperDataSource
extends java.lang.Object
implements org.apache.axiom.om.OMDataSourceExt


Field Summary
protected  java.lang.Object bean
           
protected  java.lang.String helperClassName
           
protected  QName parentQName
           
 
Constructor Summary
protected ADBHelperDataSource(java.lang.Object bean, QName parentQName, java.lang.String helperClassName)
          Constructor taking in an ADBBean
 
Method Summary
 void close()
          Close the DataSource and free its resources.
 org.apache.axiom.om.OMDataSourceExt copy()
           
 java.lang.Object getObject()
          Returns the backing Object.
 java.lang.Object getProperty(java.lang.String key)
           
 javax.xml.stream.XMLStreamReader getReader()
           
 byte[] getXMLBytes(java.lang.String encoding)
          Returns a byte[] representing the xml data
 java.io.InputStream getXMLInputStream(java.lang.String encoding)
          Returns a InputStream representing the xml data
 boolean hasProperty(java.lang.String key)
           
 boolean isDestructiveRead()
          Returns true if reading the backing object is destructive.
 boolean isDestructiveWrite()
          Returns true if writing the backing object is destructive.
 void serialize(java.io.OutputStream output, org.apache.axiom.om.OMOutputFormat format)
           
 void serialize(java.io.Writer writer, org.apache.axiom.om.OMOutputFormat format)
           
abstract  void serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
          This needs to be generated inside the ADB bean
 java.lang.Object setProperty(java.lang.String key, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentQName

protected QName parentQName

bean

protected java.lang.Object bean

helperClassName

protected java.lang.String helperClassName
Constructor Detail

ADBHelperDataSource

protected ADBHelperDataSource(java.lang.Object bean,
                              QName parentQName,
                              java.lang.String helperClassName)
Constructor taking in an ADBBean

Parameters:
bean -
Method Detail

serialize

public void serialize(java.io.OutputStream output,
                      org.apache.axiom.om.OMOutputFormat format)
               throws javax.xml.stream.XMLStreamException
Specified by:
serialize in interface org.apache.axiom.om.OMDataSource
Specified by:
serialize in interface org.apache.axiom.om.OMDataSourceExt
Parameters:
output -
format -
Throws:
javax.xml.stream.XMLStreamException
See Also:
OMDataSource.serialize(java.io.OutputStream, org.apache.axiom.om.OMOutputFormat)

serialize

public void serialize(java.io.Writer writer,
                      org.apache.axiom.om.OMOutputFormat format)
               throws javax.xml.stream.XMLStreamException
Specified by:
serialize in interface org.apache.axiom.om.OMDataSource
Specified by:
serialize in interface org.apache.axiom.om.OMDataSourceExt
Parameters:
writer -
format -
Throws:
javax.xml.stream.XMLStreamException
See Also:
OMDataSource.serialize(java.io.Writer, org.apache.axiom.om.OMOutputFormat)

serialize

public abstract void serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
                        throws javax.xml.stream.XMLStreamException
This needs to be generated inside the ADB bean

Specified by:
serialize in interface org.apache.axiom.om.OMDataSource
Specified by:
serialize in interface org.apache.axiom.om.OMDataSourceExt
Parameters:
xmlWriter -
Throws:
javax.xml.stream.XMLStreamException
See Also:
OMDataSource.serialize(javax.xml.stream.XMLStreamWriter)

getReader

public javax.xml.stream.XMLStreamReader getReader()
                                           throws javax.xml.stream.XMLStreamException
Specified by:
getReader in interface org.apache.axiom.om.OMDataSource
Specified by:
getReader in interface org.apache.axiom.om.OMDataSourceExt
Throws:
javax.xml.stream.XMLStreamException
See Also:
OMDataSource.getReader()

getObject

public java.lang.Object getObject()
Returns the backing Object.

Specified by:
getObject in interface org.apache.axiom.om.OMDataSourceExt
Returns:
Object

isDestructiveRead

public boolean isDestructiveRead()
Returns true if reading the backing object is destructive. An example of an object with a destructive read is an InputSteam. The owning OMSourcedElement uses this information to detemine if OM tree expansion is needed when reading the OMDataSourceExt.

Specified by:
isDestructiveRead in interface org.apache.axiom.om.OMDataSourceExt
Returns:
boolean

isDestructiveWrite

public boolean isDestructiveWrite()
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.

Specified by:
isDestructiveWrite in interface org.apache.axiom.om.OMDataSourceExt
Returns:
boolean

getXMLInputStream

public java.io.InputStream getXMLInputStream(java.lang.String encoding)
                                      throws java.io.UnsupportedEncodingException
Returns a InputStream representing the xml data

Specified by:
getXMLInputStream in interface org.apache.axiom.om.OMDataSourceExt
Parameters:
encoding - String encoding of InputStream
Returns:
InputStream
Throws:
java.io.UnsupportedEncodingException

getXMLBytes

public byte[] getXMLBytes(java.lang.String encoding)
                   throws java.io.UnsupportedEncodingException
Returns a byte[] representing the xml data

Specified by:
getXMLBytes in interface org.apache.axiom.om.OMDataSourceExt
Parameters:
encoding - String encoding of InputStream
Returns:
byte[]
Throws:
java.io.UnsupportedEncodingException
See Also:
getXMLInputStream

close

public void close()
Close the DataSource and free its resources.

Specified by:
close in interface org.apache.axiom.om.OMDataSourceExt

copy

public org.apache.axiom.om.OMDataSourceExt copy()
Specified by:
copy in interface org.apache.axiom.om.OMDataSourceExt

getProperty

public java.lang.Object getProperty(java.lang.String key)
Specified by:
getProperty in interface org.apache.axiom.om.OMDataSourceExt

setProperty

public java.lang.Object setProperty(java.lang.String key,
                                    java.lang.Object value)
Specified by:
setProperty in interface org.apache.axiom.om.OMDataSourceExt

hasProperty

public boolean hasProperty(java.lang.String key)
Specified by:
hasProperty in interface org.apache.axiom.om.OMDataSourceExt


Copyright © 2007 Apache Web Services Project. All Rights Reserved.