Class SourceBlockImpl

  • All Implemented Interfaces:
    org.apache.axiom.om.OMDataSource, org.apache.axiom.om.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 Detail

      • SourceBlockImpl

        public SourceBlockImpl​(org.apache.axiom.om.OMElement omElement,
                               QName qName,
                               BlockFactory factory)
        Constructor called from factory
        Parameters:
        reader -
        qName -
        factory -
    • Method Detail

      • _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 class BlockImpl<Source,​Void>
        Returns:
      • isElementData

        public boolean isElementData()
        Specified by:
        isElementData in interface Block<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 interface org.apache.axiom.om.OMDataSourceExt
        Overrides:
        close in class org.apache.axiom.om.ds.AbstractOMDataSource
      • getObject

        public Object getObject()
        Specified by:
        getObject in interface org.apache.axiom.om.OMDataSourceExt
        Overrides:
        getObject in class org.apache.axiom.om.ds.AbstractOMDataSource
      • 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