Package org.apache.axis2.saaj
Class SOAPElementImpl<T extends OMElement>
- java.lang.Object
-
- org.apache.axis2.saaj.ProxyNode<T,S>
-
- org.apache.axis2.saaj.NodeImpl<Element,T>
-
- org.apache.axis2.saaj.SOAPElementImpl<T>
-
- All Implemented Interfaces:
Node,SOAPElement,Element,Node
- Direct Known Subclasses:
DetailEntryImpl,SOAPBodyElementImpl,SOAPBodyImpl,SOAPEnvelopeImpl,SOAPFaultElementImpl,SOAPHeaderElementImpl,SOAPHeaderImpl
public class SOAPElementImpl<T extends OMElement> extends NodeImpl<Element,T> implements SOAPElement
-
-
Field Summary
-
Fields 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_NODE
-
-
Constructor Summary
Constructors Constructor Description SOAPElementImpl(T element)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SOAPElementaddAttribute(QName qname, String value)SOAPElementaddAttribute(Name name, String value)Adds an attribute with the specified name and value to thisSOAPElementobject.SOAPElementaddChildElement(String localName)SOAPElementaddChildElement(String localName, String prefix)SOAPElementaddChildElement(String localName, String prefix, String namespaceURI)SOAPElementaddChildElement(QName qname)SOAPElementaddChildElement(Name name)SOAPElementaddChildElement(SOAPElement soapElement)SOAPElementaddNamespaceDeclaration(String prefix, String uri)SOAPElementaddTextNode(String text)Creates a newTextobject initialized with the givenStringand adds it to thisSOAPElementobject.protected Objectclone()protected voidcopyContents(SOAPElementImpl childEle, Node child)QNamecreateQName(String localName, String prefix)Creates a QName whose namespace URI is the one associated with the parameter, prefix, in the context of this SOAPElement.IteratorgetAllAttributes()Returns an iterator over all of the attribute names in thisSOAPElementobject.IteratorgetAllAttributesAsQNames()StringgetAttribute(String name)AttrgetAttributeNode(String name)AttrgetAttributeNodeNS(String namespaceURI, String localName)StringgetAttributeNS(String namespaceURI, String localName)StringgetAttributeValue(QName qname)StringgetAttributeValue(Name name)IteratorgetChildElements()Returns an iterator over all the immediate content of this element.IteratorgetChildElements(QName qname)IteratorgetChildElements(Name name)NamegetElementName()QNamegetElementQName()NodeListgetElementsByTagName(String name)NodeListgetElementsByTagNameNS(String namespaceURI, String localName)StringgetEncodingStyle()IteratorgetNamespacePrefixes()StringgetNamespaceURI(String prefix)StringgetTagName()StringgetValue()Returns the the value of the immediate child of thisNodeobject if a child exists and its value is text.IteratorgetVisibleNamespacePrefixes()booleanhasAttribute(String name)booleanhasAttributeNS(String namespaceURI, String localName)voidremoveAttribute(String name)booleanremoveAttribute(QName qname)booleanremoveAttribute(Name name)AttrremoveAttributeNode(Attr attr)voidremoveAttributeNS(String namespaceURI, String localName)voidremoveContents()booleanremoveNamespaceDeclaration(String prefix)voidsetAttribute(String name, String value)AttrsetAttributeNode(Attr attr)AttrsetAttributeNodeNS(Attr attr)voidsetAttributeNS(String namespaceURI, String qualifiedName, String value)SOAPElementsetElementQName(QName newName)voidsetEncodingStyle(String encodingStyle)Sets the encoding style for this SOAPElement object to one specified.voidsetValue(String value)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.StringtoString()-
Methods inherited from class org.apache.axis2.saaj.NodeImpl
detachNode, getParentElement, setParentElement
-
Methods inherited from class org.apache.axis2.saaj.ProxyNode
appendChild, appendElement, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOMTarget, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSchemaTypeInfo, getTarget, getTextContent, getType, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, recycleNode, removeChild, replaceChild, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setPrefix, setTextContent, setType, setUserData, toSAAJNodeList
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.w3c.dom.Element
getSchemaTypeInfo, setIdAttribute, setIdAttributeNode, setIdAttributeNS
-
Methods inherited from interface javax.xml.soap.Node
detachNode, getParentElement, recycleNode, setParentElement
-
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
-
-
-
Constructor Detail
-
SOAPElementImpl
public SOAPElementImpl(T element)
-
-
Method Detail
-
addAttribute
public SOAPElement addAttribute(Name name, String value) throws SOAPException
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
public SOAPElement addChildElement(Name name) throws SOAPException
- Specified by:
addChildElementin interfaceSOAPElement- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(SOAPElement soapElement) throws SOAPException
- Specified by:
addChildElementin interfaceSOAPElement- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix, String namespaceURI) throws SOAPException
- Specified by:
addChildElementin interfaceSOAPElement- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix) throws SOAPException
- Specified by:
addChildElementin interfaceSOAPElement- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(String localName) throws SOAPException
- Specified by:
addChildElementin interfaceSOAPElement- Throws:
SOAPException
-
addNamespaceDeclaration
public SOAPElement addNamespaceDeclaration(String prefix, String uri) throws SOAPException
- Specified by:
addNamespaceDeclarationin interfaceSOAPElement- Throws:
SOAPException
-
addTextNode
public SOAPElement addTextNode(String text) throws SOAPException
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
public Iterator 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
public String getAttributeValue(Name name)
- Specified by:
getAttributeValuein interfaceSOAPElement
-
getChildElements
public Iterator 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
public Iterator getChildElements(Name name)
- Specified by:
getChildElementsin interfaceSOAPElement
-
getElementName
public Name getElementName()
- Specified by:
getElementNamein interfaceSOAPElement
-
getEncodingStyle
public String getEncodingStyle()
- Specified by:
getEncodingStylein interfaceSOAPElement
-
getNamespacePrefixes
public Iterator getNamespacePrefixes()
- Specified by:
getNamespacePrefixesin interfaceSOAPElement
-
getNamespaceURI
public String getNamespaceURI(String prefix)
- Specified by:
getNamespaceURIin interfaceSOAPElement
-
getVisibleNamespacePrefixes
public Iterator getVisibleNamespacePrefixes()
- Specified by:
getVisibleNamespacePrefixesin interfaceSOAPElement
-
addAttribute
public SOAPElement addAttribute(QName qname, String value) throws SOAPException
- Specified by:
addAttributein interfaceSOAPElement- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(QName qname) throws SOAPException
- Specified by:
addChildElementin interfaceSOAPElement- Throws:
SOAPException
-
createQName
public QName createQName(String localName, String prefix) throws SOAPException
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
public Iterator getAllAttributesAsQNames()
- Specified by:
getAllAttributesAsQNamesin interfaceSOAPElement
-
getAttributeValue
public String getAttributeValue(QName qname)
- Specified by:
getAttributeValuein interfaceSOAPElement
-
getChildElements
public Iterator getChildElements(QName qname)
- Specified by:
getChildElementsin interfaceSOAPElement
-
getElementQName
public QName getElementQName()
- Specified by:
getElementQNamein interfaceSOAPElement
-
removeAttribute
public boolean removeAttribute(QName qname)
- Specified by:
removeAttributein interfaceSOAPElement
-
setElementQName
public SOAPElement setElementQName(QName newName) throws SOAPException
- Specified by:
setElementQNamein interfaceSOAPElement- Throws:
SOAPException
-
removeAttribute
public boolean removeAttribute(Name name)
- Specified by:
removeAttributein interfaceSOAPElement
-
removeContents
public void removeContents()
- Specified by:
removeContentsin interfaceSOAPElement
-
removeNamespaceDeclaration
public boolean removeNamespaceDeclaration(String prefix)
- Specified by:
removeNamespaceDeclarationin interfaceSOAPElement
-
setEncodingStyle
public void setEncodingStyle(String encodingStyle) throws SOAPException
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
-
getAttribute
public String getAttribute(String name)
- Specified by:
getAttributein interfaceElement
-
getAttributeNode
public Attr getAttributeNode(String name)
- Specified by:
getAttributeNodein interfaceElement
-
getAttributeNodeNS
public Attr getAttributeNodeNS(String namespaceURI, String localName)
- Specified by:
getAttributeNodeNSin interfaceElement
-
getAttributeNS
public String getAttributeNS(String namespaceURI, String localName)
- Specified by:
getAttributeNSin interfaceElement
-
getElementsByTagName
public NodeList getElementsByTagName(String name)
- Specified by:
getElementsByTagNamein interfaceElement
-
getElementsByTagNameNS
public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
- Specified by:
getElementsByTagNameNSin interfaceElement
-
getTagName
public String getTagName()
- Specified by:
getTagNamein interfaceElement
-
hasAttribute
public boolean hasAttribute(String name)
- Specified by:
hasAttributein interfaceElement
-
hasAttributeNS
public boolean hasAttributeNS(String namespaceURI, String localName)
- Specified by:
hasAttributeNSin interfaceElement
-
removeAttribute
public void removeAttribute(String name) throws DOMException
- Specified by:
removeAttributein interfaceElement- Throws:
DOMException
-
removeAttributeNode
public Attr removeAttributeNode(Attr attr) throws DOMException
- Specified by:
removeAttributeNodein interfaceElement- Throws:
DOMException
-
removeAttributeNS
public void removeAttributeNS(String namespaceURI, String localName) throws DOMException
- Specified by:
removeAttributeNSin interfaceElement- Throws:
DOMException
-
setAttribute
public void setAttribute(String name, String value) throws DOMException
- Specified by:
setAttributein interfaceElement- Throws:
DOMException
-
setAttributeNode
public Attr setAttributeNode(Attr attr) throws DOMException
- Specified by:
setAttributeNodein interfaceElement- Throws:
DOMException
-
setAttributeNodeNS
public Attr setAttributeNodeNS(Attr attr) throws DOMException
- Specified by:
setAttributeNodeNSin interfaceElement- Throws:
DOMException
-
setAttributeNS
public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException
- Specified by:
setAttributeNSin interfaceElement- Throws:
DOMException
-
getValue
public String getValue()
Returns the the value of the immediate child of thisNodeobject if a child exists and its value is text.
-
clone
protected Object clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
setValue
public void setValue(String value)
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
-
copyContents
protected void copyContents(SOAPElementImpl childEle, Node child) throws SOAPException
- Throws:
SOAPException
-
-