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 SOAPElement
addAttribute(QName qname, String value)
SOAPElement
addAttribute(Name name, String value)
Adds an attribute with the specified name and value to thisSOAPElement
object.SOAPElement
addChildElement(String localName)
SOAPElement
addChildElement(String localName, String prefix)
SOAPElement
addChildElement(String localName, String prefix, String namespaceURI)
SOAPElement
addChildElement(QName qname)
SOAPElement
addChildElement(Name name)
SOAPElement
addChildElement(SOAPElement soapElement)
SOAPElement
addNamespaceDeclaration(String prefix, String uri)
SOAPElement
addTextNode(String text)
Creates a newText
object initialized with the givenString
and adds it to thisSOAPElement
object.protected Object
clone()
protected void
copyContents(SOAPElementImpl childEle, Node child)
QName
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.Iterator
getAllAttributes()
Returns an iterator over all of the attribute names in thisSOAPElement
object.Iterator
getAllAttributesAsQNames()
String
getAttribute(String name)
Attr
getAttributeNode(String name)
Attr
getAttributeNodeNS(String namespaceURI, String localName)
String
getAttributeNS(String namespaceURI, String localName)
String
getAttributeValue(QName qname)
String
getAttributeValue(Name name)
Iterator
getChildElements()
Returns an iterator over all the immediate content of this element.Iterator
getChildElements(QName qname)
Iterator
getChildElements(Name name)
Name
getElementName()
QName
getElementQName()
NodeList
getElementsByTagName(String name)
NodeList
getElementsByTagNameNS(String namespaceURI, String localName)
String
getEncodingStyle()
Iterator
getNamespacePrefixes()
String
getNamespaceURI(String prefix)
String
getTagName()
String
getValue()
Returns the the value of the immediate child of thisNode
object if a child exists and its value is text.Iterator
getVisibleNamespacePrefixes()
boolean
hasAttribute(String name)
boolean
hasAttributeNS(String namespaceURI, String localName)
void
removeAttribute(String name)
boolean
removeAttribute(QName qname)
boolean
removeAttribute(Name name)
Attr
removeAttributeNode(Attr attr)
void
removeAttributeNS(String namespaceURI, String localName)
void
removeContents()
boolean
removeNamespaceDeclaration(String prefix)
void
setAttribute(String name, String value)
Attr
setAttributeNode(Attr attr)
Attr
setAttributeNodeNS(Attr attr)
void
setAttributeNS(String namespaceURI, String qualifiedName, String value)
SOAPElement
setElementQName(QName newName)
void
setEncodingStyle(String encodingStyle)
Sets the encoding style for this SOAPElement object to one specified.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.String
toString()
-
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 thisSOAPElement
object.- Specified by:
addAttribute
in interfaceSOAPElement
- Parameters:
name
- aName
object with the name of the attributevalue
- aString
giving the value of the attribute- Returns:
- the
SOAPElement
object 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:
addChildElement
in interfaceSOAPElement
- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(SOAPElement soapElement) throws SOAPException
- Specified by:
addChildElement
in interfaceSOAPElement
- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix, String namespaceURI) throws SOAPException
- Specified by:
addChildElement
in interfaceSOAPElement
- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(String localName, String prefix) throws SOAPException
- Specified by:
addChildElement
in interfaceSOAPElement
- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(String localName) throws SOAPException
- Specified by:
addChildElement
in interfaceSOAPElement
- Throws:
SOAPException
-
addNamespaceDeclaration
public SOAPElement addNamespaceDeclaration(String prefix, String uri) throws SOAPException
- Specified by:
addNamespaceDeclaration
in interfaceSOAPElement
- Throws:
SOAPException
-
addTextNode
public SOAPElement addTextNode(String text) throws SOAPException
Creates a newText
object initialized with the givenString
and adds it to thisSOAPElement
object.- Specified by:
addTextNode
in interfaceSOAPElement
- Parameters:
text
- aString
object with the textual content to be added- Returns:
- the
SOAPElement
object into which the newText
object was inserted - Throws:
SOAPException
- if there is an error in creating the newText
object
-
getAllAttributes
public Iterator getAllAttributes()
Returns an iterator over all of the attribute names in thisSOAPElement
object. The iterator can be used to get the attribute names, which can then be passed to the methodgetAttributeValue
to retrieve the value of each attribute.- Specified by:
getAllAttributes
in interfaceSOAPElement
- Returns:
- an iterator over the names of the attributes
-
getAttributeValue
public String getAttributeValue(Name name)
- Specified by:
getAttributeValue
in interfaceSOAPElement
-
getChildElements
public Iterator getChildElements()
Returns an iterator over all the immediate content of this element. This includesText
objects as well asSOAPElement
objects.- Specified by:
getChildElements
in interfaceSOAPElement
- Returns:
- an iterator over
Text
andSOAPElement
contained within thisSOAPElement
object
-
getChildElements
public Iterator getChildElements(Name name)
- Specified by:
getChildElements
in interfaceSOAPElement
-
getElementName
public Name getElementName()
- Specified by:
getElementName
in interfaceSOAPElement
-
getEncodingStyle
public String getEncodingStyle()
- Specified by:
getEncodingStyle
in interfaceSOAPElement
-
getNamespacePrefixes
public Iterator getNamespacePrefixes()
- Specified by:
getNamespacePrefixes
in interfaceSOAPElement
-
getNamespaceURI
public String getNamespaceURI(String prefix)
- Specified by:
getNamespaceURI
in interfaceSOAPElement
-
getVisibleNamespacePrefixes
public Iterator getVisibleNamespacePrefixes()
- Specified by:
getVisibleNamespacePrefixes
in interfaceSOAPElement
-
addAttribute
public SOAPElement addAttribute(QName qname, String value) throws SOAPException
- Specified by:
addAttribute
in interfaceSOAPElement
- Throws:
SOAPException
-
addChildElement
public SOAPElement addChildElement(QName qname) throws SOAPException
- Specified by:
addChildElement
in 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:
createQName
in 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:
getAllAttributesAsQNames
in interfaceSOAPElement
-
getAttributeValue
public String getAttributeValue(QName qname)
- Specified by:
getAttributeValue
in interfaceSOAPElement
-
getChildElements
public Iterator getChildElements(QName qname)
- Specified by:
getChildElements
in interfaceSOAPElement
-
getElementQName
public QName getElementQName()
- Specified by:
getElementQName
in interfaceSOAPElement
-
removeAttribute
public boolean removeAttribute(QName qname)
- Specified by:
removeAttribute
in interfaceSOAPElement
-
setElementQName
public SOAPElement setElementQName(QName newName) throws SOAPException
- Specified by:
setElementQName
in interfaceSOAPElement
- Throws:
SOAPException
-
removeAttribute
public boolean removeAttribute(Name name)
- Specified by:
removeAttribute
in interfaceSOAPElement
-
removeContents
public void removeContents()
- Specified by:
removeContents
in interfaceSOAPElement
-
removeNamespaceDeclaration
public boolean removeNamespaceDeclaration(String prefix)
- Specified by:
removeNamespaceDeclaration
in interfaceSOAPElement
-
setEncodingStyle
public void setEncodingStyle(String encodingStyle) throws SOAPException
Sets the encoding style for this SOAPElement object to one specified.- Specified by:
setEncodingStyle
in 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:
getAttribute
in interfaceElement
-
getAttributeNode
public Attr getAttributeNode(String name)
- Specified by:
getAttributeNode
in interfaceElement
-
getAttributeNodeNS
public Attr getAttributeNodeNS(String namespaceURI, String localName)
- Specified by:
getAttributeNodeNS
in interfaceElement
-
getAttributeNS
public String getAttributeNS(String namespaceURI, String localName)
- Specified by:
getAttributeNS
in interfaceElement
-
getElementsByTagName
public NodeList getElementsByTagName(String name)
- Specified by:
getElementsByTagName
in interfaceElement
-
getElementsByTagNameNS
public NodeList getElementsByTagNameNS(String namespaceURI, String localName)
- Specified by:
getElementsByTagNameNS
in interfaceElement
-
getTagName
public String getTagName()
- Specified by:
getTagName
in interfaceElement
-
hasAttribute
public boolean hasAttribute(String name)
- Specified by:
hasAttribute
in interfaceElement
-
hasAttributeNS
public boolean hasAttributeNS(String namespaceURI, String localName)
- Specified by:
hasAttributeNS
in interfaceElement
-
removeAttribute
public void removeAttribute(String name) throws DOMException
- Specified by:
removeAttribute
in interfaceElement
- Throws:
DOMException
-
removeAttributeNode
public Attr removeAttributeNode(Attr attr) throws DOMException
- Specified by:
removeAttributeNode
in interfaceElement
- Throws:
DOMException
-
removeAttributeNS
public void removeAttributeNS(String namespaceURI, String localName) throws DOMException
- Specified by:
removeAttributeNS
in interfaceElement
- Throws:
DOMException
-
setAttribute
public void setAttribute(String name, String value) throws DOMException
- Specified by:
setAttribute
in interfaceElement
- Throws:
DOMException
-
setAttributeNode
public Attr setAttributeNode(Attr attr) throws DOMException
- Specified by:
setAttributeNode
in interfaceElement
- Throws:
DOMException
-
setAttributeNodeNS
public Attr setAttributeNodeNS(Attr attr) throws DOMException
- Specified by:
setAttributeNodeNS
in interfaceElement
- Throws:
DOMException
-
setAttributeNS
public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException
- Specified by:
setAttributeNS
in interfaceElement
- Throws:
DOMException
-
getValue
public String getValue()
Returns the the value of the immediate child of thisNode
object if a child exists and its value is text.
-
clone
protected Object clone() throws CloneNotSupportedException
- Overrides:
clone
in 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:
setValue
in 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
-
-