org.apache.axis2.jaxws.message.databinding.impl
Class JAXBBlockImpl

java.lang.Object
  extended by org.apache.axis2.jaxws.message.impl.BlockImpl
      extended by org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl
All Implemented Interfaces:
org.apache.axiom.om.OMDataSource, org.apache.axiom.om.OMDataSourceExt, Block, JAXBBlock

public class JAXBBlockImpl
extends BlockImpl
implements JAXBBlock

JAXBBlockImpl

A Block containing a JAXB business object (either a JAXBElement or an object with @XmlRootElement).


Field Summary
 
Fields inherited from class org.apache.axis2.jaxws.message.impl.BlockImpl
busContext, busObject, consumed, factory, omElement, parent, qName
 
Method Summary
protected  java.lang.Object _getBOFromOM(org.apache.axiom.om.OMElement omElement, java.lang.Object busContext)
          Default method for getting business object from OM.
protected  java.lang.Object _getBOFromReader(javax.xml.stream.XMLStreamReader reader, java.lang.Object busContext)
          The derived class must provide an implementation that builds the business object from the reader
protected  javax.xml.stream.XMLStreamReader _getReaderFromBO(java.lang.Object busObj, java.lang.Object busContext)
          Get an XMLStreamReader for the BusinessObject The derived Block must implement this method
protected  void _outputFromBO(java.lang.Object busObject, java.lang.Object busContext, javax.xml.stream.XMLStreamWriter writer)
          Output BusinessObject contents to a Writer.
 void close()
           
 org.apache.axiom.om.OMDataSourceExt copy()
           
 java.lang.Object getObject()
           
 byte[] getXMLBytes(java.lang.String encoding)
           
 java.io.InputStream getXMLInputStream(java.lang.String encoding)
           
 boolean isDestructiveRead()
           
 boolean isDestructiveWrite()
           
 boolean isElementData()
           
 void setParent(Message message)
          Set the Message associated with this block (This method is intended to be called by the Message Implementation only)
 
Methods inherited from class org.apache.axis2.jaxws.message.impl.BlockImpl
_getBOFromBO, _getOMFromBO, _getReaderFromOM, _outputFromOM, _outputFromReader, _postPivot_getXMLStreamReader, _postPivot_outputTo, getBlockFactory, getBusinessContext, getBusinessObject, getOMElement, getParent, getProperty, getQName, getReader, getXMLStreamReader, hasProperty, isBusinessObject, isConsumed, isQNameAvailable, outputTo, serialize, serialize, serialize, setConsumed, setProperty, setQName, traceString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.axis2.jaxws.message.Block
getBlockFactory, getBusinessContext, getBusinessObject, getOMElement, getParent, getQName, getXMLStreamReader, isConsumed, isQNameAvailable, outputTo, traceString
 
Methods inherited from interface org.apache.axiom.om.OMDataSourceExt
getProperty, getReader, hasProperty, serialize, serialize, serialize, setProperty
 

Method Detail

_getBOFromReader

protected java.lang.Object _getBOFromReader(javax.xml.stream.XMLStreamReader reader,
                                            java.lang.Object busContext)
                                     throws javax.xml.stream.XMLStreamException,
                                            WebServiceException
Description copied from class: BlockImpl
The derived class must provide an implementation that builds the business object from the reader

Specified by:
_getBOFromReader in class BlockImpl
Parameters:
reader - XMLStreamReader, which is consumed
Returns:
Throws:
javax.xml.stream.XMLStreamException
WebServiceException

_getBOFromOM

protected java.lang.Object _getBOFromOM(org.apache.axiom.om.OMElement omElement,
                                        java.lang.Object busContext)
                                 throws javax.xml.stream.XMLStreamException,
                                        WebServiceException
Description copied from class: BlockImpl
Default method for getting business object from OM. Derived classes may override this method to get the business object from a data source.

Overrides:
_getBOFromOM in class BlockImpl
Returns:
Business Object
Throws:
javax.xml.stream.XMLStreamException
WebServiceException

_getReaderFromBO

protected javax.xml.stream.XMLStreamReader _getReaderFromBO(java.lang.Object busObj,
                                                            java.lang.Object busContext)
                                                     throws javax.xml.stream.XMLStreamException,
                                                            WebServiceException
Description copied from class: BlockImpl
Get an XMLStreamReader for the BusinessObject The derived Block must implement this method

Specified by:
_getReaderFromBO in class BlockImpl
Returns:
Throws:
javax.xml.stream.XMLStreamException
WebServiceException

_outputFromBO

protected void _outputFromBO(java.lang.Object busObject,
                             java.lang.Object busContext,
                             javax.xml.stream.XMLStreamWriter writer)
                      throws javax.xml.stream.XMLStreamException,
                             WebServiceException
Description copied from class: BlockImpl
Output BusinessObject contents to a Writer. Derived classes must provide this implementation

Specified by:
_outputFromBO in class BlockImpl
Throws:
javax.xml.stream.XMLStreamException
WebServiceException

isElementData

public boolean isElementData()
Specified by:
isElementData in interface Block
Returns:
true if data is always an element; false if possibly mixed content or multiple elements

close

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

getXMLInputStream

public java.io.InputStream getXMLInputStream(java.lang.String encoding)
                                      throws java.io.UnsupportedEncodingException
Specified by:
getXMLInputStream in interface org.apache.axiom.om.OMDataSourceExt
Throws:
java.io.UnsupportedEncodingException

getObject

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

isDestructiveRead

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

isDestructiveWrite

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

copy

public org.apache.axiom.om.OMDataSourceExt copy()
                                         throws org.apache.axiom.om.OMException
Specified by:
copy in interface org.apache.axiom.om.OMDataSourceExt
Overrides:
copy in class BlockImpl
Throws:
org.apache.axiom.om.OMException

getXMLBytes

public byte[] getXMLBytes(java.lang.String encoding)
                   throws java.io.UnsupportedEncodingException
Specified by:
getXMLBytes in interface org.apache.axiom.om.OMDataSourceExt
Throws:
java.io.UnsupportedEncodingException

setParent

public void setParent(Message message)
Description copied from interface: Block
Set the Message associated with this block (This method is intended to be called by the Message Implementation only)

Specified by:
setParent in interface Block
Overrides:
setParent in class BlockImpl


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