org.apache.axiom.soap.impl.llom
Class SOAPEnvelopeImpl

java.lang.Object
  extended by org.apache.axiom.om.impl.llom.OMSerializableImpl
      extended by org.apache.axiom.om.impl.llom.OMNodeImpl
          extended by org.apache.axiom.om.impl.llom.OMElementImpl
              extended by org.apache.axiom.soap.impl.llom.SOAPElement
                  extended by org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl
All Implemented Interfaces:
OMContainerEx, OMNodeEx, OMConstants, OMContainer, OMElement, OMNode, OMSerializable, SOAPEnvelope

public class SOAPEnvelopeImpl
extends SOAPElement
implements SOAPEnvelope, OMConstants

Class SOAPEnvelopeImpl


Field Summary
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMElementImpl
attributes, DEFAULT_DEFAULT_NS_OBJECT, firstChild, lastChild, localName, namespaces, noPrefixNamespaceCounter, ns, qName
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
nextSibling, nodeType, parent, previousSibling
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
builder, done, factory
 
Fields inherited from interface org.apache.axiom.om.OMNode
CDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODE
 
Fields inherited from interface org.apache.axiom.om.OMConstants
ARRAY_ITEM_LOCALNAME, ARRAY_ITEM_NS_PREFIX, ARRAY_ITEM_NSURI, ARRAY_ITEM_QNAME, DATA_HANDLER, DEFAULT_CHAR_SET_ENCODING, DEFAULT_DEFAULT_NAMESPACE, DEFAULT_XML_VERSION, IS_BINARY, IS_DATA_HANDLERS_AWARE, PULL_TYPE_BUILDER, PUSH_TYPE_BUILDER, XMLATTRTYPE_CDATA, XMLATTRTYPE_ENTITIES, XMLATTRTYPE_ENTITY, XMLATTRTYPE_ID, XMLATTRTYPE_IDREF, XMLATTRTYPE_IDREFS, XMLATTRTYPE_NMTOKEN, XMLATTRTYPE_NMTOKENS, XMLATTRTYPE_NOTATION, XMLNS_NS_PREFIX, XMLNS_NS_URI, XMLNS_PREFIX, XMLNS_URI
 
Constructor Summary
SOAPEnvelopeImpl(OMNamespace ns, SOAPFactory factory)
          Constructor
SOAPEnvelopeImpl(OMXMLParserWrapper builder, SOAPFactory factory)
          Constructor
 
Method Summary
 void addChild(OMNode child)
          Add a SOAPHeader or SOAPBody object
protected  void checkParent(OMElement parent)
          This has to be implemented by all the derived classes to check for the correct parent.
 OMNode detach()
          Method detach
 SOAPBody getBody()
          Returns the SOAPBody object associated with this SOAPEnvelope object.
 SOAPHeader getHeader()
          Returns the SOAPHeader object for this SOAPEnvelope object.
 String getSOAPBodyFirstElementLocalName()
          Retrieves the local name of the first element in the body.
 OMNamespace getSOAPBodyFirstElementNS()
          Retrieves the OMNamespace of the first element in the body.
 SOAPVersion getVersion()
           
 boolean hasFault()
          Returns true if there is a SOAPFault in the body.
 void internalSerialize(XMLStreamWriter writer2, boolean cache)
          Serializes the node.
 
Methods inherited from class org.apache.axiom.soap.impl.llom.SOAPElement
registerContentHandler, setParent
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMElementImpl
addAttribute, addAttribute, build, buildNext, buildWithAttachments, cloneOMElement, declareDefaultNamespace, declareNamespace, declareNamespace, discard, findNamespace, findNamespaceURI, getAllAttributes, getAllDeclaredNamespaces, getAttribute, getAttributeValue, getBuilder, getChildElements, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getDefaultNamespace, getFirstChildWithName, getFirstElement, getFirstOMChild, getFirstOMChildIfAvailable, getLineNumber, getLocalName, getNamespace, getNamespaceURI, getNextOMSibling, getQName, getText, getTextAsQName, getTrimmedText, getType, getXMLStreamReader, getXMLStreamReader, getXMLStreamReaderWithoutCaching, notifyChildComplete, removeAttribute, resolveQName, setBuilder, setFirstChild, setLastChild, setLineNumber, setLocalName, setNamespace, setNamespaceWithNoFindInCurrentScope, setText, setText, toString, toStringWithConsume
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
getNextOMSiblingIfAvailable, getParent, getPreviousOMSibling, importNode, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerializeAndConsume, setComplete, setNextOMSibling, setPreviousOMSibling, setType
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
close, getOMFactory, isComplete, serialize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.axiom.om.OMElement
addAttribute, addAttribute, cloneOMElement, declareDefaultNamespace, declareNamespace, declareNamespace, findNamespace, findNamespaceURI, getAllAttributes, getAllDeclaredNamespaces, getAttribute, getAttributeValue, getChildElements, getDefaultNamespace, getFirstElement, getLineNumber, getLocalName, getNamespace, getNamespaceURI, getQName, getText, getTextAsQName, removeAttribute, resolveQName, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setBuilder, setFirstChild, setLineNumber, setLocalName, setNamespace, setNamespaceWithNoFindInCurrentScope, setText, setText, toString, toStringWithConsume
 
Methods inherited from interface org.apache.axiom.om.OMNode
buildWithAttachments, discard, getNextOMSibling, getParent, getPreviousOMSibling, getType, insertSiblingAfter, insertSiblingBefore
 
Methods inherited from interface org.apache.axiom.om.OMContainer
buildNext, getBuilder, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getFirstChildWithName, getFirstOMChild, getXMLStreamReader, getXMLStreamReader, getXMLStreamReaderWithoutCaching
 
Methods inherited from interface org.apache.axiom.om.OMSerializable
build, close, getOMFactory, isComplete, serialize, serialize, serializeAndConsume
 
Methods inherited from interface org.apache.axiom.om.impl.OMContainerEx
setComplete
 

Constructor Detail

SOAPEnvelopeImpl

public SOAPEnvelopeImpl(OMXMLParserWrapper builder,
                        SOAPFactory factory)
Constructor

Parameters:
builder - the OMXMLParserWrapper building this envelope
factory - the SOAPFactory building this envelope

SOAPEnvelopeImpl

public SOAPEnvelopeImpl(OMNamespace ns,
                        SOAPFactory factory)
Constructor

Parameters:
ns - OMNamespace for this envelope
factory - SOAPFactory associated with this envelope
Method Detail

getVersion

public SOAPVersion getVersion()
Specified by:
getVersion in interface SOAPEnvelope

getHeader

public SOAPHeader getHeader()
                     throws OMException
Returns the SOAPHeader object for this SOAPEnvelope object.

This SOAPHeader will just be a container for all the headers in the OMMessage

Specified by:
getHeader in interface SOAPEnvelope
Returns:
the SOAPHeader object or null if there is none
Throws:
OMException - if there is a problem obtaining the SOAPHeader object

addChild

public void addChild(OMNode child)
Add a SOAPHeader or SOAPBody object

Specified by:
addChild in interface OMContainer
Overrides:
addChild in class OMElementImpl
Parameters:
child - an OMNode to add - must be either a SOAPHeader or a SOAPBody

getBody

public SOAPBody getBody()
                 throws OMException
Returns the SOAPBody object associated with this SOAPEnvelope object.

This SOAPBody will just be a container for all the BodyElements in the OMMessage

Specified by:
getBody in interface SOAPEnvelope
Returns:
the SOAPBody object for this SOAPEnvelope object or null if there is none
Throws:
OMException - if there is a problem obtaining the SOAPBody object

detach

public OMNode detach()
              throws OMException
Method detach

Specified by:
detach in interface OMNode
Overrides:
detach in class OMElementImpl
Returns:
The detached node. This is always the instance on which this method is invoked.
Throws:
OMException

checkParent

protected void checkParent(OMElement parent)
                    throws SOAPProcessingException
Description copied from class: SOAPElement
This has to be implemented by all the derived classes to check for the correct parent.

Specified by:
checkParent in class SOAPElement
Throws:
SOAPProcessingException

internalSerialize

public void internalSerialize(XMLStreamWriter writer2,
                              boolean cache)
                       throws XMLStreamException
Description copied from class: OMSerializableImpl
Serializes the node.

Specified by:
internalSerialize in interface OMNodeEx
Overrides:
internalSerialize in class OMElementImpl
cache - indicates if caching should be enabled
Throws:
XMLStreamException

hasFault

public boolean hasFault()
Description copied from interface: SOAPEnvelope
Returns true if there is a SOAPFault in the body. The implementation may choose to get this information by building the OM tree or use parser provided information.

Specified by:
hasFault in interface SOAPEnvelope
Returns:
true if SOAPFault in the body

getSOAPBodyFirstElementLocalName

public String getSOAPBodyFirstElementLocalName()
Description copied from interface: SOAPEnvelope
Retrieves the local name of the first element in the body. The implementation might build the OMElement or it may obtain this information from the builder/parser without building the OMElement. Use this method in the situations where you need to know the name, but don't necessarily need the OMElement.

Specified by:
getSOAPBodyFirstElementLocalName in interface SOAPEnvelope
Returns:
local name of first element in the body or null

getSOAPBodyFirstElementNS

public OMNamespace getSOAPBodyFirstElementNS()
Description copied from interface: SOAPEnvelope
Retrieves the OMNamespace of the first element in the body. The implementation might build the OMElement or it may obtain this information from the builder/parser without building the OMElement. Use this method in the situations where you need to know the OMNamespace, but don't necessarily need the OMElement.

Specified by:
getSOAPBodyFirstElementNS in interface SOAPEnvelope
Returns:
OMNamespace of first element in the body or null


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