org.apache.axiom.soap.impl.builder
Class StAXSOAPModelBuilder

java.lang.Object
  extended by org.apache.axiom.om.impl.builder.StAXBuilder
      extended by org.apache.axiom.om.impl.builder.StAXOMBuilder
          extended by org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder
All Implemented Interfaces:
OMXMLParserWrapper, SOAPModelBuilder
Direct Known Subclasses:
MTOMStAXSOAPModelBuilder

public class StAXSOAPModelBuilder
extends StAXOMBuilder
implements SOAPModelBuilder

StAX based builder that produces a SOAP infoset model. It builds SOAP specific objects such as SOAPEnvelope, SOAPHeader, SOAPHeaderBlock and SOAPBody.

This builder offers two different ways to handle SOAP versions:

In both cases, the SOAPFactory is retrieved either from the OMMetaFactory specified when the builder is constructed, or if none is specified, from the default meta factory returned by OMAbstractFactory.getMetaFactory().


Field Summary
 
Fields inherited from class org.apache.axiom.om.impl.builder.StAXBuilder
_isClosed, _releaseParserOnClose, cache, charEncoding, customBuilderForPayload, customBuilders, dataHandlerReader, document, done, elementLevel, maxDepthForCustomBuilders, omfactory, parser, parserAccessed, parserException, target
 
Constructor Summary
StAXSOAPModelBuilder(OMMetaFactory metaFactory, XMLStreamReader parser)
          Constructor.
StAXSOAPModelBuilder(OMMetaFactory metaFactory, XMLStreamReader parser, String soapVersion)
          Constructor.
StAXSOAPModelBuilder(XMLStreamReader parser)
          Constructor.
StAXSOAPModelBuilder(XMLStreamReader parser, SOAPFactory factory, String soapVersion)
          Constructor.
StAXSOAPModelBuilder(XMLStreamReader parser, String soapVersion)
          Constructor.
 
Method Summary
protected  OMElement constructNode(OMContainer parent, String elementName)
          Instantiate the appropriate OMElement implementation for the current element.
protected  OMDocument createDocument()
           
protected  OMNode createDTD()
          Method createDTD.
protected  OMNode createEntityReference()
           
protected  OMNode createNextOMElement()
          Creates a new OMElement using either a CustomBuilder or the default Builder mechanism.
protected  OMNode createPI()
          Method createPI.
 OMNamespace getEnvelopeNamespace()
           
 SOAPEnvelope getSOAPEnvelope()
          Get the SOAP envelope for the document processed by this builder.
 SOAPFactory getSOAPFactory()
           
 SOAPMessage getSoapMessage()
           
protected  void identifySOAPVersion(String soapVersionURIFromTransport)
           
 
Methods inherited from class org.apache.axiom.om.impl.builder.StAXOMBuilder
createComment, createOMElement, createPrefix, createWithCustomBuilder, getDocumentElement, getDocumentElement, isLookahead, isNamespaceURIInterning, logParserState, lookahead, next, processNamespaceData, setDoDebug, setNamespaceURIInterning
 
Methods inherited from class org.apache.axiom.om.impl.builder.StAXBuilder
close, createDocumentIfNecessary, createOMText, debugDiscarded, discard, discard, getAttributeCount, getAttributeName, getAttributeNamespace, getAttributePrefix, getBuilderType, getCharacterEncoding, getCharsetEncoding, getCustomBuilder, getDocument, getName, getNamespace, getNamespaceCount, getNamespacePrefix, getNamespaceUri, getParser, getPrefix, getReaderProperty, getRegisteredContentHandler, getText, init, isCache, isClosed, isCompleted, processAttributes, registerCustomBuilder, registerCustomBuilderForPayload, registerExternalContentHandler, releaseParserOnClose, setCache, setOMBuilderFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.axiom.om.OMXMLParserWrapper
close, discard, getBuilderType, getCharacterEncoding, getDocument, getDocumentElement, getDocumentElement, getParser, getRegisteredContentHandler, isCache, isCompleted, next, registerExternalContentHandler, setCache
 

Constructor Detail

StAXSOAPModelBuilder

public StAXSOAPModelBuilder(XMLStreamReader parser,
                            String soapVersion)
Constructor.

Parameters:
parser - the parser to read the SOAP message from
soapVersion - the namespace URI corresponding to the expected SOAP version of the message

StAXSOAPModelBuilder

public StAXSOAPModelBuilder(OMMetaFactory metaFactory,
                            XMLStreamReader parser,
                            String soapVersion)
Constructor.

Parameters:
metaFactory - the meta factory used to get the appropriate SOAPFactory implementation
parser - the parser to read the SOAP message from
soapVersion - the namespace URI corresponding to the expected SOAP version of the message

StAXSOAPModelBuilder

public StAXSOAPModelBuilder(XMLStreamReader parser)
Constructor.

Parameters:
parser - the parser to read the SOAP message from

StAXSOAPModelBuilder

public StAXSOAPModelBuilder(OMMetaFactory metaFactory,
                            XMLStreamReader parser)
Constructor.

Parameters:
metaFactory - the meta factory used to get the appropriate SOAPFactory implementation
parser - the parser to read the SOAP message from

StAXSOAPModelBuilder

public StAXSOAPModelBuilder(XMLStreamReader parser,
                            SOAPFactory factory,
                            String soapVersion)
Constructor.

Parameters:
parser - the parser to read the SOAP message from
factory - the SOAP factory to use
soapVersion - the namespace URI corresponding to the expected SOAP version of the message
Method Detail

identifySOAPVersion

protected void identifySOAPVersion(String soapVersionURIFromTransport)
Parameters:
soapVersionURIFromTransport -

getSOAPEnvelope

public SOAPEnvelope getSOAPEnvelope()
                             throws OMException
Description copied from interface: SOAPModelBuilder
Get the SOAP envelope for the document processed by this builder.

Specified by:
getSOAPEnvelope in interface SOAPModelBuilder
Returns:
the SOAP envelope
Throws:
OMException

createNextOMElement

protected OMNode createNextOMElement()
Description copied from class: StAXOMBuilder
Creates a new OMElement using either a CustomBuilder or the default Builder mechanism.

Overrides:
createNextOMElement in class StAXOMBuilder
Returns:
TODO

constructNode

protected OMElement constructNode(OMContainer parent,
                                  String elementName)
Description copied from class: StAXOMBuilder
Instantiate the appropriate OMElement implementation for the current element. This method may be overridden by subclasses to support model specific OMElement types. The implementation of this method is expected to initialize the OMElement with the specified local name and to add it to the specified parent. However, the implementation should not set the namespace of the element or process the attributes of the element. This is taken care of by the caller of this method.

Overrides:
constructNode in class StAXOMBuilder
Parameters:
parent - the parent for the element
elementName - the local name for the element
Returns:
the newly created OMElement; must not be null

createDocument

protected OMDocument createDocument()
Overrides:
createDocument in class StAXOMBuilder

createDTD

protected OMNode createDTD()
                    throws OMException
Method createDTD. Overriding the default behaviour as a SOAPMessage should not have a DTD.

Overrides:
createDTD in class StAXOMBuilder
Returns:
Returns OMNode.
Throws:
OMException

createPI

protected OMNode createPI()
                   throws OMException
Method createPI. Overriding the default behaviour as a SOAP Message should not have a PI.

Overrides:
createPI in class StAXOMBuilder
Returns:
Returns OMNode.
Throws:
OMException

createEntityReference

protected OMNode createEntityReference()
Overrides:
createEntityReference in class StAXOMBuilder

getEnvelopeNamespace

public OMNamespace getEnvelopeNamespace()

getSoapMessage

public SOAPMessage getSoapMessage()

getSOAPFactory

public SOAPFactory getSOAPFactory()


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.