Class SourceBlockImpl
- java.lang.Object
-
- org.apache.axiom.om.ds.AbstractOMDataSource
-
- org.apache.axis2.jaxws.message.impl.BlockImpl<Source,Void>
-
- org.apache.axis2.jaxws.message.databinding.impl.SourceBlockImpl
-
- All Implemented Interfaces:
OMDataSource
,OMDataSourceExt
,Block<Source,Void>
,SourceBlock
public class SourceBlockImpl extends BlockImpl<Source,Void> implements SourceBlock
SourceBlock Block containing a business object that is a javax.xml.transform.Source. The javax.xml.transform.Source is an interface. The actual concrete class may be one of the following: - StreamSource - DOMSource - JAXBSource - SAXSource - StAXSource During processing of the block, the block is free to change the representation from one source to another. (i.e. if you initially seed this with a SAXSource, but a later access may give you a StAXSource). A Source is consumed when read. The block will make a copy of the source if a non-consumable request is made.
-
-
Constructor Summary
Constructors Constructor Description SourceBlockImpl(OMElement omElement, QName qName, BlockFactory factory)
Constructor called from factory
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Source
_getBOFromBO(Source busObject, Void busContext, boolean consume)
The default implementation is to return the business object.protected Source
_getBOFromOM(OMElement omElement, Void busContext)
Default method for getting business object from OM.protected XMLStreamReader
_getReaderFromBO(Source busObj, Void busContext)
Get an XMLStreamReader for the BusinessObject The derived Block must implement this methodprotected void
_outputFromBO(Source busObject, Void busContext, XMLStreamWriter writer)
Output BusinessObject contents to a Writer.void
close()
Object
getObject()
boolean
isDestructiveRead()
boolean
isDestructiveWrite()
boolean
isElementData()
-
Methods inherited from class org.apache.axis2.jaxws.message.impl.BlockImpl
_getOMFromBO, _outputFromOM, _outputFromReader, _postPivot_getXMLStreamReader, _postPivot_outputTo, copy, getBlockFactory, getBusinessContext, getBusinessObject, getOMElement, getParent, getQName, getReader, getXMLStreamReader, isBusinessObject, isConsumed, isQNameAvailable, outputTo, serialize, setConsumed, setParent, setQName, traceString
-
Methods inherited from class org.apache.axiom.om.ds.AbstractOMDataSource
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.axis2.jaxws.message.Block
getBlockFactory, getBusinessContext, getBusinessObject, getOMElement, getParent, getQName, getXMLStreamReader, isConsumed, isQNameAvailable, outputTo, setParent, traceString
-
Methods inherited from interface org.apache.axiom.om.OMDataSource
getReader, serialize, serialize, serialize
-
Methods inherited from interface org.apache.axiom.om.OMDataSourceExt
copy, getProperty, getXMLBytes, getXMLInputStream, hasProperty, setProperty
-
-
-
-
Constructor Detail
-
SourceBlockImpl
public SourceBlockImpl(OMElement omElement, QName qName, BlockFactory factory)
Constructor called from factory- Parameters:
reader
-qName
-factory
-
-
-
Method Detail
-
_getBOFromOM
protected Source _getBOFromOM(OMElement omElement, Void busContext) throws 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.- Specified by:
_getBOFromOM
in classBlockImpl<Source,Void>
- Returns:
- Business Object
- Throws:
XMLStreamException
WebServiceException
-
_getReaderFromBO
protected XMLStreamReader _getReaderFromBO(Source busObj, Void busContext) throws XMLStreamException, WebServiceException
Description copied from class:BlockImpl
Get an XMLStreamReader for the BusinessObject The derived Block must implement this method- Specified by:
_getReaderFromBO
in classBlockImpl<Source,Void>
- Returns:
- Throws:
XMLStreamException
WebServiceException
-
_outputFromBO
protected void _outputFromBO(Source busObject, Void busContext, XMLStreamWriter writer) throws XMLStreamException, WebServiceException
Description copied from class:BlockImpl
Output BusinessObject contents to a Writer. Derived classes must provide this implementation- Specified by:
_outputFromBO
in classBlockImpl<Source,Void>
- Throws:
XMLStreamException
WebServiceException
-
_getBOFromBO
protected Source _getBOFromBO(Source busObject, Void busContext, boolean consume)
Description copied from class:BlockImpl
The default implementation is to return the business object. A derived block may want to override this class if the business object is consumed when read (thus the dervived block may want to make a buffered copy) (An example use case for overriding this method is the businessObject is an InputSource)- Overrides:
_getBOFromBO
in classBlockImpl<Source,Void>
- Returns:
-
isElementData
public boolean isElementData()
- Specified by:
isElementData
in interfaceBlock<Source,Void>
- Returns:
- true if data is always an element; false if possibly mixed content or multiple elements
-
close
public void close()
- Specified by:
close
in interfaceOMDataSourceExt
- Overrides:
close
in classAbstractOMDataSource
-
getObject
public Object getObject()
- Specified by:
getObject
in interfaceOMDataSourceExt
- Overrides:
getObject
in classAbstractOMDataSource
-
isDestructiveRead
public boolean isDestructiveRead()
- Specified by:
isDestructiveRead
in interfaceOMDataSourceExt
-
isDestructiveWrite
public boolean isDestructiveWrite()
- Specified by:
isDestructiveWrite
in interfaceOMDataSourceExt
-
-