Interface Block<T,C>

All Superinterfaces:
org.apache.axiom.om.OMDataSource, org.apache.axiom.om.OMDataSourceExt
All Known Subinterfaces:
DataSourceBlock, JAXBBlock, OMBlock, SOAPEnvelopeBlock, SourceBlock, XMLStringBlock
All Known Implementing Classes:
BlockImpl, DataSourceBlockImpl, JAXBBlockImpl, OMBlockImpl, SOAPEnvelopeBlockImpl, SourceBlockImpl, XMLStringBlockImpl

public interface Block<T,C> extends org.apache.axiom.om.OMDataSourceExt
Block A Block represents an xml element and associated sub-tree. The name of the element must be defined by a root element in a schema. All prefixes within the subtree must correspond to namespace declarations defined within the tree. Many specifications refer to this as a "embedded document" or "xml block". I chose the term, block, for simplicity.

The block can be exposed as: * BusinessObject * StAX object

Note that the whole Message can also be thought of as a Block. Thus a Message can be createFrom a Block and written as a Block.

In addition, each of the accessors has a consume parameter. If consume is true, the Block is no longer valid after the message is called. (i.e. the implementation does not need to cache the information)

  • Method Summary

    Modifier and Type
    Method
    Description
    Get BlockFactory
    GetBusinesContext Some business objects have an associated context object (i.e.
    getBusinessObject(boolean consume)
    Get a reference to the Business Object represented by this Block
    org.apache.axiom.om.OMElement
    Get the OMElement represented by this Block.
    Get the Message associated with this block
    Get the QName (namespace, localpart) of the Block.
    getXMLStreamReader(boolean consume)
    Get the XMLStreamReader represented by this Block
    boolean
    isConsumed Return true if the block is consumed.
    boolean
     
    boolean
     
    void
    outputTo(XMLStreamWriter writer, boolean consume)
    Write out the Block
    void
    Set the Message associated with this block (This method is intended to be called by the Message Implementation only)
    Get a traceString...the trace string dumps the contents of the Block without forcing an underlying ill-performant transformation of the message.

    Methods inherited from interface org.apache.axiom.om.OMDataSource

    getReader, serialize, serialize, serialize

    Methods inherited from interface org.apache.axiom.om.OMDataSourceExt

    close, copy, getObject, getProperty, getXMLBytes, getXMLInputStream, hasProperty, isDestructiveRead, isDestructiveWrite, setProperty
  • Method Details

    • getBusinessObject

      Object getBusinessObject(boolean consume) throws XMLStreamException, jakarta.xml.ws.WebServiceException
      Get a reference to the Business Object represented by this Block
      Parameters:
      consume - true if this is the last request on the block.
      Returns:
      Object (JAXB, String etc.)
      Throws:
      XMLStreamException
      jakarta.xml.ws.WebServiceException
    • getBusinessContext

      Object getBusinessContext()
      GetBusinesContext Some business objects have an associated context object (i.e. JAXBContext)
      Returns:
      Context Object or null
    • getXMLStreamReader

      XMLStreamReader getXMLStreamReader(boolean consume) throws XMLStreamException, jakarta.xml.ws.WebServiceException
      Get the XMLStreamReader represented by this Block
      Parameters:
      consume - true if this is the last request on the block.
      Returns:
      XMLStreamReader
      Throws:
      XMLStreamException
      jakarta.xml.ws.WebServiceException
    • getOMElement

      org.apache.axiom.om.OMElement getOMElement() throws XMLStreamException, jakarta.xml.ws.WebServiceException
      Get the OMElement represented by this Block. This call always consumes the block because you are taking control of the underlying OM
      Returns:
      Throws:
      XMLStreamException
      jakarta.xml.ws.WebServiceException
    • outputTo

      void outputTo(XMLStreamWriter writer, boolean consume) throws XMLStreamException, jakarta.xml.ws.WebServiceException
      Write out the Block
      Parameters:
      writer - XMLStreamWriter
      consume - true if this is the last request on the block.
      Throws:
      XMLStreamException
      jakarta.xml.ws.WebServiceException
    • isConsumed

      boolean isConsumed()
      isConsumed Return true if the block is consumed. Once consumed, the information in the block is no longer available.
      Returns:
      true if the block is consumed (a method was called with consume=true)
    • traceString

      String traceString(String indent)
      Get a traceString...the trace string dumps the contents of the Block without forcing an underlying ill-performant transformation of the message.
      Returns:
      String containing trace information
    • isQNameAvailable

      boolean isQNameAvailable()
      Returns:
      If QName is available without doing an expensive parse of the business object, then return true Otherwise return false Note: This method should be used in situations where it would be nice to know the qname (like logging or a special check) but we don't want to cause an ill-performant parse.
    • getQName

      QName getQName() throws jakarta.xml.ws.WebServiceException
      Get the QName (namespace, localpart) of the Block. Do not depend on prefix being set correctly. Asking for the QName can cause a performant hit.
      Returns:
      QName of the block
      Throws:
      jakarta.xml.ws.WebServiceException
      See Also:
    • getBlockFactory

      BlockFactory getBlockFactory()
      Get BlockFactory
      Returns:
      BlockFactory that created the Block
    • getParent

      Message getParent()
      Get the Message associated with this block
      Returns:
      Message
    • setParent

      void setParent(Message parent)
      Set the Message associated with this block (This method is intended to be called by the Message Implementation only)
      Parameters:
      parent -
    • isElementData

      boolean isElementData()
      Returns:
      true if data is always an element; false if possibly mixed content or multiple elements