Package org.apache.axis2.saaj
Class SOAPElementImpl
java.lang.Object
org.apache.axiom.om.impl.dom.NodeImpl
org.apache.axis2.saaj.NodeImplEx
org.apache.axis2.saaj.SOAPElementImpl
- All Implemented Interfaces:
Cloneable,Node,SOAPElement,org.apache.axiom.om.impl.OMNodeEx,org.apache.axiom.om.OMNode,org.apache.axiom.om.OMSerializable,Element,Node,NodeList
- Direct Known Subclasses:
DetailEntryImpl,SOAPBodyElementImpl,SOAPBodyImpl,SOAPEnvelopeImpl,SOAPFaultElementImpl,SOAPHeaderElementImpl,SOAPHeaderImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.axiom.om.impl.dom.ElementImplUsing a delegate because we can't extend from org.apache.axiom.om.impl.dom.ElementImpl since this class must extend SNodeImplFields inherited from class org.apache.axis2.saaj.NodeImplEx
parentElementFields inherited from class org.apache.axiom.om.impl.dom.NodeImpl
builder, done, factory, FIRSTCHILD, flags, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIEDFields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODEFields 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(QName qname, String value) addAttribute(Name name, String value) Adds an attribute with the specified name and value to thisSOAPElementobject.addChildElement(String localName) addChildElement(String localName, String prefix) addChildElement(String localName, String prefix, String uri) addChildElement(QName qname) addChildElement(Name name) addChildElement(SOAPElement soapElement) addNamespaceDeclaration(String prefix, String uri) addTextNode(String text) Creates a newTextobject initialized with the givenStringand adds it to thisSOAPElementobject.appendChild(Node child) protected ElementappendElement(org.apache.axiom.om.impl.dom.ElementImpl child) protected TextappendText(Text child) protected Objectclone()protected voidcopyContents(SOAPElementImpl childEle, Node child) createQName(String localName, String prefix) Creates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement.org.apache.axiom.om.OMNodedetach()voidRemoves thisNodeobject from the tree.voiddiscard()Returns an iterator over all of the attribute names in thisSOAPElementobject.getAttribute(String name) getAttributeNode(String name) getAttributeNodeNS(String namespaceURI, String localName) getAttributeNS(String namespaceURI, String localName) Returns the collection of attributes associated with this node, or null if none.getAttributeValue(QName qname) getAttributeValue(Name name) Returns an iterator over all the immediate content of this element.getChildElements(QName qname) getChildElements(Name name) org.apache.axiom.om.impl.dom.ElementImplgetElementsByTagName(String name) getElementsByTagNameNS(String namespaceURI, String localName) Method getLastChildgetNamespaceURI(String prefix) dom Node methodshortFind the Document that this Node belongs to (the document in whose context the Node was created).Returns the parent element of thisNodeobject.getValue()Returns the the value of the immediate child of thisNodeobject if a child exists and its value is text.booleanhasAttribute(String name) booleanhasAttributeNS(String namespaceURI, String localName) booleanvoidinternalSerialize(XMLStreamWriter writer, boolean cache) voidremoveAttribute(String name) booleanremoveAttribute(QName qname) booleanremoveAttribute(Name name) removeAttributeNode(Attr attr) voidremoveAttributeNS(String namespaceURI, String localName) removeChild(Node oldChild) voidbooleanremoveNamespaceDeclaration(String prefix) voidsetAttribute(String name, String value) setAttributeNode(Attr attr) setAttributeNodeNS(Attr attr) voidsetAttributeNS(String namespaceURI, String qualifiedName, String value) setElementQName(QName newName) voidsetEncodingStyle(String encodingStyle) Sets the encoding style for this SOAPElement object to one specified.voidsetParent(org.apache.axiom.om.OMContainer parentElement) voidsetParentElement(SOAPElement parent) Sets the parent of thisNodeobject to the givenSOAPElementobject.voidIf this is a Text node then this method will set its value, otherwise it sets the value of the immediate (Text) child of this node.toString()Methods inherited from class org.apache.axis2.saaj.NodeImplEx
getParent, getSchemaTypeInfo, getType, recycleNode, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setTypeMethods inherited from class org.apache.axiom.om.impl.dom.NodeImpl
build, buildWithAttachments, cloneNode, close, compareDocumentPosition, getBaseURI, getFeature, getLength, getNextOMSibling, getNextOMSiblingIfAvailable, getNodeValue, getOMFactory, getPreviousOMSibling, getUserData, hasAttributes, insertBefore, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerializeAndConsume, isComplete, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, normalize, replaceChild, serialize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNextOMSibling, setNodeValue, setOwnerDocument, setPrefix, setPreviousOMSibling, setTextContent, setUserDataMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.w3c.dom.Element
getSchemaTypeInfo, setIdAttribute, setIdAttributeNode, setIdAttributeNSMethods inherited from interface javax.xml.soap.Node
recycleNodeMethods inherited from interface org.w3c.dom.Node
cloneNode, compareDocumentPosition, getBaseURI, getFeature, getNodeValue, getUserData, hasAttributes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Field Details
-
element
protected org.apache.axiom.om.impl.dom.ElementImpl elementUsing a delegate because we can't extend from org.apache.axiom.om.impl.dom.ElementImpl since this class must extend SNodeImpl
-
-
Constructor Details
-
SOAPElementImpl
public SOAPElementImpl(org.apache.axiom.om.impl.dom.ElementImpl element)
-
-
Method Details
-
discard
public void discard() throws org.apache.axiom.om.OMException- Specified by:
discardin interfaceorg.apache.axiom.om.OMNode- Throws:
org.apache.axiom.om.OMException
-
internalSerialize
- Specified by:
internalSerializein interfaceorg.apache.axiom.om.impl.OMNodeEx- Throws:
XMLStreamException
-
addAttribute
Adds an attribute with the specified name and value to thisSOAPElementobject.- Specified by:
addAttributein interfaceSOAPElement- Parameters:
name- aNameobject with the name of the attributevalue- aStringgiving the value of the attribute- Returns:
- the
SOAPElementobject into which the attribute was inserted - Throws:
SOAPException- if there is an error in creating the Attribute
-
addChildElement
- Specified by:
addChildElementin interfaceSOAPElement- Throws:
SOAPException
-
addChildElement
- Specified by:
addChildElementin interfaceSOAPElement- Throws:
SOAPException
-
getLocalName
- Specified by:
getLocalNamein interfaceNode- Overrides:
getLocalNamein classorg.apache.axiom.om.impl.dom.NodeImpl
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceNode- Overrides:
getNamespaceURIin classorg.apache.axiom.om.impl.dom.NodeImpl
-
getPrefix
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix, String uri) throws SOAPException - Specified by:
addChildElementin interfaceSOAPElement- Throws:
SOAPException
-
addChildElement
- Specified by:
addChildElementin interfaceSOAPElement- Throws:
SOAPException
-
addChildElement
- Specified by:
addChildElementin interfaceSOAPElement- Throws:
SOAPException
-
addNamespaceDeclaration
- Specified by:
addNamespaceDeclarationin interfaceSOAPElement- Throws:
SOAPException
-
addTextNode
Creates a newTextobject initialized with the givenStringand adds it to thisSOAPElementobject.- Specified by:
addTextNodein interfaceSOAPElement- Parameters:
text- aStringobject with the textual content to be added- Returns:
- the
SOAPElementobject into which the newTextobject was inserted - Throws:
SOAPException- if there is an error in creating the newTextobject
-
getAllAttributes
Returns an iterator over all of the attribute names in thisSOAPElementobject. The iterator can be used to get the attribute names, which can then be passed to the methodgetAttributeValueto retrieve the value of each attribute.- Specified by:
getAllAttributesin interfaceSOAPElement- Returns:
- an iterator over the names of the attributes
-
getAttributeValue
- Specified by:
getAttributeValuein interfaceSOAPElement
-
getChildElements
Returns an iterator over all the immediate content of this element. This includesTextobjects as well asSOAPElementobjects.- Specified by:
getChildElementsin interfaceSOAPElement- Returns:
- an iterator over
TextandSOAPElementcontained within thisSOAPElementobject
-
getChildElements
- Specified by:
getChildElementsin interfaceSOAPElement
-
getElementName
- Specified by:
getElementNamein interfaceSOAPElement
-
getEncodingStyle
- Specified by:
getEncodingStylein interfaceSOAPElement
-
getNamespacePrefixes
- Specified by:
getNamespacePrefixesin interfaceSOAPElement
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceSOAPElement
-
getVisibleNamespacePrefixes
- Specified by:
getVisibleNamespacePrefixesin interfaceSOAPElement
-
addAttribute
- Specified by:
addAttributein interfaceSOAPElement- Throws:
SOAPException
-
addChildElement
- Specified by:
addChildElementin interfaceSOAPElement- Throws:
SOAPException
-
createQName
Creates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement. The remaining elements of the new QName are taken directly from the parameters, localName and prefix.- Specified by:
createQNamein interfaceSOAPElement- Parameters:
localName- - a String containing the local part of the name. prefix - a String containing the prefix for the name.- Returns:
- a QName with the specified localName and prefix, and with a namespace that is associated with the prefix in the context of this SOAPElement. This namespace will be the same as the one that would be returned by getNamespaceURI(String) if it were given prefix as its parameter.
- Throws:
SOAPException- - if the QName cannot be created.- Since:
- SAAJ 1.3
-
getAllAttributesAsQNames
- Specified by:
getAllAttributesAsQNamesin interfaceSOAPElement
-
getAttributeValue
- Specified by:
getAttributeValuein interfaceSOAPElement
-
getChildElements
- Specified by:
getChildElementsin interfaceSOAPElement
-
getElementQName
- Specified by:
getElementQNamein interfaceSOAPElement
-
removeAttribute
- Specified by:
removeAttributein interfaceSOAPElement
-
setElementQName
- Specified by:
setElementQNamein interfaceSOAPElement- Throws:
SOAPException
-
removeAttribute
- Specified by:
removeAttributein interfaceSOAPElement
-
removeContents
public void removeContents()- Specified by:
removeContentsin interfaceSOAPElement
-
removeNamespaceDeclaration
- Specified by:
removeNamespaceDeclarationin interfaceSOAPElement
-
setEncodingStyle
Sets the encoding style for this SOAPElement object to one specified.- Specified by:
setEncodingStylein interfaceSOAPElement- Parameters:
encodingStyle- - a String giving the encoding style- Throws:
IllegalArgumentException- - if there was a problem in the encoding style being set. SOAPException - if setting the encodingStyle is invalid for this SOAPElement.SOAPException
-
setParent
public void setParent(org.apache.axiom.om.OMContainer parentElement) - Specified by:
setParentin interfaceorg.apache.axiom.om.impl.OMNodeEx
-
getAttribute
- Specified by:
getAttributein interfaceElement
-
getAttributeNode
- Specified by:
getAttributeNodein interfaceElement
-
getAttributeNodeNS
- Specified by:
getAttributeNodeNSin interfaceElement
-
getAttributeNS
- Specified by:
getAttributeNSin interfaceElement
-
getElementsByTagName
- Specified by:
getElementsByTagNamein interfaceElement
-
getElementsByTagNameNS
- Specified by:
getElementsByTagNameNSin interfaceElement
-
getTagName
- Specified by:
getTagNamein interfaceElement
-
hasAttribute
- Specified by:
hasAttributein interfaceElement
-
hasAttributeNS
- Specified by:
hasAttributeNSin interfaceElement
-
removeAttribute
- Specified by:
removeAttributein interfaceElement- Throws:
DOMException
-
removeAttributeNode
- Specified by:
removeAttributeNodein interfaceElement- Throws:
DOMException
-
removeAttributeNS
- Specified by:
removeAttributeNSin interfaceElement- Throws:
DOMException
-
setAttribute
- Specified by:
setAttributein interfaceElement- Throws:
DOMException
-
setAttributeNode
- Specified by:
setAttributeNodein interfaceElement- Throws:
DOMException
-
setAttributeNodeNS
- Specified by:
setAttributeNodeNSin interfaceElement- Throws:
DOMException
-
setAttributeNS
public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException - Specified by:
setAttributeNSin interfaceElement- Throws:
DOMException
-
getNodeName
- Specified by:
getNodeNamein interfaceNode
-
getNodeType
public short getNodeType()- Specified by:
getNodeTypein interfaceNode
-
getElement
public org.apache.axiom.om.impl.dom.ElementImpl getElement() -
getParentElement
Returns the parent element of thisNodeobject. This method can throw anUnsupportedOperationExceptionif the tree is not kept in memory.- Specified by:
getParentElementin interfaceNode- Overrides:
getParentElementin classNodeImplEx- Returns:
- the
SOAPElementobject that is the parent of thisNodeobject ornullif thisNodeobject is root - Throws:
UnsupportedOperationException- if the whole tree is not kept in memory- See Also:
-
setParentElement
Description copied from class:NodeImplExSets the parent of thisNodeobject to the givenSOAPElementobject.- Specified by:
setParentElementin interfaceNode- Overrides:
setParentElementin classNodeImplEx- Parameters:
parent- theSOAPElementobject to be set as the parent of thisNodeobject- Throws:
SOAPException- if there is a problem in setting the parent to the given element- See Also:
-
getOwnerDocument
Find the Document that this Node belongs to (the document in whose context the Node was created). The Node may or may not- Specified by:
getOwnerDocumentin interfaceNode- Overrides:
getOwnerDocumentin classorg.apache.axiom.om.impl.dom.NodeImpl
-
getValue
Returns the the value of the immediate child of thisNodeobject if a child exists and its value is text.- Specified by:
getValuein interfaceNode- Overrides:
getValuein classNodeImplEx- Returns:
- a
Stringwith the text of the immediate child of thisNodeobject if (1) there is a child and (2) the child is aTextobject;nullotherwise
-
getTextContent
- Specified by:
getTextContentin interfaceNode- Overrides:
getTextContentin classorg.apache.axiom.om.impl.dom.NodeImpl- Throws:
DOMException
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
getFirstChild
- Specified by:
getFirstChildin interfaceNode- Overrides:
getFirstChildin classorg.apache.axiom.om.impl.dom.NodeImpl
-
getLastChild
Method getLastChild- Specified by:
getLastChildin interfaceNode- Overrides:
getLastChildin classorg.apache.axiom.om.impl.dom.NodeImpl- See Also:
-
getParentNode
- Specified by:
getParentNodein interfaceNode- Overrides:
getParentNodein classorg.apache.axiom.om.impl.dom.NodeImpl
-
getNextSibling
dom Node method- Specified by:
getNextSiblingin interfaceNode- Overrides:
getNextSiblingin classorg.apache.axiom.om.impl.dom.NodeImpl
-
getPreviousSibling
- Specified by:
getPreviousSiblingin interfaceNode- Overrides:
getPreviousSiblingin classorg.apache.axiom.om.impl.dom.NodeImpl
-
getChildNodes
- Specified by:
getChildNodesin interfaceNode- Overrides:
getChildNodesin classorg.apache.axiom.om.impl.dom.NodeImpl
-
hasChildNodes
public boolean hasChildNodes()- Specified by:
hasChildNodesin interfaceNode- Overrides:
hasChildNodesin classorg.apache.axiom.om.impl.dom.NodeImpl
-
setValue
If this is a Text node then this method will set its value, otherwise it sets the value of the immediate (Text) child of this node. The value of the immediate child of this node can be set only if, there is one child node and that node is a Text node, or if there are no children in which case a child Text node will be created.- Specified by:
setValuein interfaceNode- Parameters:
value- the text to set- Throws:
IllegalStateException- if the node is not a Text node and either has more than one child node or has a child node that is not a Text node
-
detachNode
public void detachNode()Description copied from class:NodeImplExRemoves thisNodeobject from the tree. Once removed, this node can be garbage collected if there are no application references to it.- Specified by:
detachNodein interfaceNode- Overrides:
detachNodein classNodeImplEx
-
detach
public org.apache.axiom.om.OMNode detach()- Specified by:
detachin interfaceorg.apache.axiom.om.OMNode- Overrides:
detachin classNodeImplEx
-
getAttributes
Returns the collection of attributes associated with this node, or null if none. At this writing, Element is the only type of node which will ever have attributes.- Specified by:
getAttributesin interfaceNode- Overrides:
getAttributesin classorg.apache.axiom.om.impl.dom.NodeImpl- See Also:
-
toString
-
removeChild
- Specified by:
removeChildin interfaceNode- Overrides:
removeChildin classorg.apache.axiom.om.impl.dom.NodeImpl- Throws:
DOMException
-
appendChild
- Specified by:
appendChildin interfaceNode- Overrides:
appendChildin classorg.apache.axiom.om.impl.dom.NodeImpl- Throws:
DOMException
-
appendText
- Throws:
SOAPException
-
appendElement
protected Element appendElement(org.apache.axiom.om.impl.dom.ElementImpl child) throws SOAPException - Throws:
SOAPException
-
copyContents
- Throws:
SOAPException
-