Package org.apache.axis.message
Class MessageElement
java.lang.Object
org.apache.axis.message.NodeImpl
org.apache.axis.message.MessageElement
- All Implemented Interfaces:
Serializable,Cloneable,Node,SOAPElement,Element,Node,NodeList
- Direct Known Subclasses:
DetailEntry,RPCParam,SOAPBody,SOAPBodyElement,SOAPEnvelope,SOAPFaultElement,SOAPHeader,SOAPHeaderElement
public class MessageElement
extends NodeImpl
implements SOAPElement, Serializable, NodeList, Cloneable
MessageElement is the base type of nodes of the SOAP message parse tree.
Note: it was made Serializable to help users of Apache SOAP who had
exploited the serializability of the DOM tree to migrate to Axis.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classclass that represents a qname in a the qNameAttrs vector. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected DeserializationContextprotected StringOur encoding style, if anyprotected intprotected Deserializer!!! TODO : Make sure this handles multiple targetsprotected Stringprotected Stringprotected static org.apache.commons.logging.Logprotected SOAPEnvelopeprotected Vectorprotected SAX2EventRecorderprotected intprotected intprotected QNameFields inherited from class org.apache.axis.message.NodeImpl
_isDirty, attributes, children, document, name, namespaceURI, parent, prefix, textRepFields 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
ConstructorsConstructorDescriptionNo-arg constructor for building messages?MessageElement(String namespace, String localPart) constructorMessageElement(String namespace, String localPart, Object value) constructor binding the internal object value field to the value parameterMessageElement(String localPart, String prefix, String namespace) constructor.MessageElement(String namespace, String localPart, String prefix, Attributes attributes, DeserializationContext context) Advanced constructor used for deserialization.MessageElement(QName name) constructor declaring the qualified name of the nodeMessageElement(QName name, Object value) constructor declaring the qualified name of the node and its valueMessageElement(Name eltName) construct using aNameimplementation,MessageElement(CharacterData text) construct a text element.MessageElement(Element elem) create a node through a deep copy of the passed in element. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String namespace, String localName, String value) add a normal CDATA/text attribute.voidaddAttribute(String attrPrefix, String namespace, String localName, String value) add an attribute.voidaddAttribute(String namespace, String localName, QName value) add an attribute to the qname vector.addAttribute(Name attrName, String value) add a new attributevoidNote that this method will log a error and no-op if there is a value (set using setObjectValue) in the MessageElement.addChildElement(String localName) add a child element in the message element's own namespaceaddChildElement(String localName, String prefixName) add a child elementaddChildElement(String localName, String childPrefix, String uri) add a child elementaddChildElement(Name childName) add the child elementaddChildElement(SOAPElement element) The added child must be an instance of MessageElement rather than an abitrary SOAPElement otherwise a (wrapped) ClassCastException will be thrown.voidaddMapping(Mapping map) add a new namespace/prefix mappingaddNamespaceDeclaration(String prefix, String uri) create aMappingmapping and add to our namespace list.add a text node to the document.protected voidchildDeepCloned(NodeImpl oldNode, NodeImpl newNode) cloneNode(boolean deep) Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes.protected Objectcloning()protected clone method (not public) copied status ------------------- protected String name ; Y protected String prefix ; Y protected String namespaceURI ; Y protected transient Attributes attributes Y protected String id; Y? protected String href; Y? protected boolean _isRoot = true; Y? protected SOAPEnvelope message = null; N? protected transient DeserializationContext context; Y? protected transient QName typeQName = null; Y? protected Vector qNameAttrs = null; Y? protected transient SAX2EventRecorder recorder = null; N? protected int startEventIndex = 0; N? protected int startContentsIndex = 0; N? protected int endEventIndex = -1; N? protected CharacterData textRep = null; Y? protected MessageElement parent = null; N public ArrayList namespaces = null; Y protected String encodingStyle = null; N? private Object objectValue = null; N?voidremove all children.booleanequality test.protected MessageElementfindElement(Vector vec, String namespace, String localPart) Get an interator to all the attributes of the node.get the message element as a document.getAsDOM()create a DOM from the message element, by serializing and deserializing the elementget the message element as a string.getAttribute(String attrName) get an attribute by namegetAttributeNode(String attrName) Deprecated.this is not implementedgetAttributeNodeNS(String namespace, String localName) Deprecated.not implemented!getAttributeNS(String namespaceURI, String localName) get the attribute with namespace/local name match.get the attributesgetAttributeValue(String localName) get the value of an attributegetAttributeValue(Name attrName) Get the value of an attribute whose namespace and local name are described.getChildElement(QName qname) Convenience method to get the first matching child for a given QName.get an iterator over the children This iterator may get confused if changes are made to the children while the iteration is in progress.getChildElements(QName qname) get an iterator over child elementsgetChildElements(Name childName) get an iterator over child elementsget a list of childrenObtain an Attributes collection consisting of all attributes for this MessageElement, including namespace declarations.Retrieve the DeserializationContext associated with this MessageElementget the full name of the elementgetElementsByTagName(String tagName) getElementsByTagNameNS(String namespace, String localName) protected NodeListgetElementsNS(Element parentElement, String namespace, String localName) helper method for recusively getting the element that has namespace URI and localnameGet the encoding style.get our current envelopegetHref()get a saved hrefgetID()get a saved IDintThe number of nodes in the list.getName()get the local name of this elementget an iterator of the prefixes.getNamespaceURI(String searchPrefix) map from a prefix to a namespace.Returns value of the node as an object of registered type.getObjectValue(Class cls) Returns value of the node as an object of registered type.TheDocumentobject associated with this node.get the prefix for a given namespace URIgetQName()get the fully qualified name of this elementget the 'real' element -will follow hrefs.get the event recordergetType()get the element's type.getValue()Get the value of the doc as a string.getValueAsType(QName type) getValueAsType(QName type, Class cls) This is deserialization logic mixed in to our element class.protected Stringget an iterator over visible prefixes.booleanhasAttribute(String attrName) test for an attribute existingbooleanhasAttributeNS(String namespace, String localName) Test for an attributebooleanisRoot()get the is-root flagitem(int index) get a child nodefinal voidoutput(SerializationContext outputContext) This is the public output() method, which will always simply use the recorded SAX stream for this element if it is available.protected voidoutputImpl(SerializationContext outputContext) override point -output to a serialization context.voidpublishContents(ContentHandler handler) replay the sax events to a SAX content handlesvoidpublishToHandler(ContentHandler handler) replay the sax events to a handlervoidremoveAttribute(String attrName) remove a named attribute.booleanremoveAttribute(Name attrName) remove an elementremoveAttributeNode(Attr oldAttr) remove a an attribuevoidremoveAttributeNS(String namespace, String localName) Remove an attribute.voidremove all chidlren.booleanremoveNamespaceDeclaration(String namespacePrefix) remove a namespace declaration.voidsetAllAttributes(Attributes attrs) set all the attributes of this instancevoidsetAttribute(String name, String value) set or update an attribute.voidsetAttribute(String namespace, String localName, String value) Set an attribute, adding the attribute if it isn't already present in this element, and changing the value if it is.setAttributeNode(Attr newAttr) Deprecated.this is not implementedsetAttributeNodeNS(Attr newAttr) set an attribute as a nodevoidsetAttributeNS(String namespaceURI, String qualifiedName, String value) set an attribute or alter an existing onevoidsetContentsIndex(int index) set the index point of our content's starting in the event recordingvoidsetEncodingStyle(String encodingStyle) Sets the encoding style for thisSOAPElementobject to one specified.voidsetEndIndex(int endIndex) record the end index of the SAX recording.voidsetEnvelope(SOAPEnvelope env) bind a a new soap envelope.voidvoidset the local part of this element's namevoidsetNamespaceURI(String nsURI) set the namespace URI of the elementvoidsetNSMappings(ArrayList namespaces) set a new namespace mapping listvoidsetObjectValue(Object newValue) Sets value of this node to an Object.voidset the name and namespace of this elementvoidset the event recordervoidset the element's typevoidIf 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()Generate a string representation by serializing our contents This is not a lightweight operation, and is repeated whenever you call this method.Methods inherited from class org.apache.axis.message.NodeImpl
appendChild, compareDocumentPosition, convertAttrSAXtoDOM, detachNode, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getParent, getParentElement, getParentNode, getPrefix, getPreviousSibling, getSchemaTypeInfo, getTextContent, getUserData, hasAttributes, hasChildNodes, initializeChildren, insertBefore, isDefaultNamespace, isDirty, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, makeAttributesEditable, normalize, recycleNode, removeChild, replaceChild, reset, setDirty, setDirty, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setNodeValue, setOwnerDocument, setParent, setParentElement, setPrefix, setTextContent, setUserDataMethods inherited from class java.lang.Object
clone, 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
detachNode, getParentElement, recycleNode, setParentElementMethods inherited from interface org.w3c.dom.Node
appendChild, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Field Details
-
log
protected static org.apache.commons.logging.Log log -
id
-
href
-
_isRoot
protected boolean _isRoot -
message
-
context
-
typeQName
-
qNameAttrs
-
recorder
-
startEventIndex
protected int startEventIndex -
startContentsIndex
protected int startContentsIndex -
endEventIndex
protected int endEventIndex -
namespaces
-
encodingStyle
Our encoding style, if any -
fixupDeserializer
!!! TODO : Make sure this handles multiple targets
-
-
Constructor Details
-
MessageElement
public MessageElement()No-arg constructor for building messages? -
MessageElement
constructor- Parameters:
namespace- namespace of elementlocalPart- local name
-
MessageElement
constructor. Automatically adds a namespace-prefix mapping to the mapping table- Parameters:
localPart- local nameprefix- prefixnamespace- namespace
-
MessageElement
construct using aNameimplementation,- Parameters:
eltName-- See Also:
-
MessageElement
constructor binding the internal object value field to the value parameter- Parameters:
namespace- namespace of the elementlocalPart- local namevalue- value of the node
-
MessageElement
constructor declaring the qualified name of the node- Parameters:
name- naming information
-
MessageElement
constructor declaring the qualified name of the node and its value- Parameters:
name- naming informationvalue- value of the node
-
MessageElement
create a node through a deep copy of the passed in element.- Parameters:
elem- name to copy from
-
MessageElement
construct a text element.- Parameters:
text- text data. This is not copied; it is referred to in the MessageElement.
-
MessageElement
public MessageElement(String namespace, String localPart, String prefix, Attributes attributes, DeserializationContext context) throws AxisFault Advanced constructor used for deserialization.- The context provides the mappings and Sax event recorder
- The soap messaging style is determined from the current message context, defaulting to SOAP1.1 if there is no current context.
- if there is an id attribute (any namespace), then the ID is registered
with
DeserializationContext.registerElementByID(String, MessageElement);a new recorder is created if needed. - If there is an attribute "root" in the default SOAP namespace, then it is examined to see if it marks the element as root (value=="1" or not)
- If there is an arrayType attribute then we assume we are an array and set our
typeQNamefield appropriately. - The
hreffield is set if there is a relevant href value
- Parameters:
namespace- namespace namespace of elementlocalPart- local name local name of elementprefix- prefix prefix of elementattributes- attributes to save as our attributescontext- deserialization context for this message element- Throws:
AxisFault- if the encoding style is not recognized/supported
-
-
Method Details
-
getDeserializationContext
Retrieve the DeserializationContext associated with this MessageElement- Returns:
- The DeserializationContext associated with this MessageElement
-
setFixupDeserializer
-
getFixupDeserializer
-
setEndIndex
public void setEndIndex(int endIndex) record the end index of the SAX recording.- Parameters:
endIndex- end value
-
isRoot
public boolean isRoot()get the is-root flag- Returns:
- true if the element is considered a document root.
-
getID
get a saved ID- Returns:
- ID or null for no ID
-
getHref
get a saved href- Returns:
- href or null
-
getAttributesEx
get the attributes- Returns:
- attributes. If this equals
NullAttributes.singletonit is null
-
cloneNode
Returns a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNodeisnull.).
Cloning anElementcopies all attributes and their values, including those generated by the XML processor to represent defaulted attributes, but this method does not copy any text it contains unless it is a deep clone, since the text is contained in a childTextnode. Cloning anAttributedirectly, as opposed to be cloned as part of anElementcloning operation, returns a specified attribute (specifiedistrue). Cloning any other type of node simply returns a copy of this node.
Note that cloning an immutable subtree results in a mutable copy, but the children of anEntityReferenceclone are readonly . In addition, clones of unspecifiedAttrnodes are specified. And, cloningDocument,DocumentType,Entity, andNotationnodes is implementation dependent. -
childDeepCloned
-
cloning
protected clone method (not public) copied status ------------------- protected String name ; Y protected String prefix ; Y protected String namespaceURI ; Y protected transient Attributes attributes Y protected String id; Y? protected String href; Y? protected boolean _isRoot = true; Y? protected SOAPEnvelope message = null; N? protected transient DeserializationContext context; Y? protected transient QName typeQName = null; Y? protected Vector qNameAttrs = null; Y? protected transient SAX2EventRecorder recorder = null; N? protected int startEventIndex = 0; N? protected int startContentsIndex = 0; N? protected int endEventIndex = -1; N? protected CharacterData textRep = null; Y? protected MessageElement parent = null; N public ArrayList namespaces = null; Y protected String encodingStyle = null; N? private Object objectValue = null; N?- Returns:
- Throws:
CloneNotSupportedException
-
setAllAttributes
set all the attributes of this instance- Parameters:
attrs- a new attributes list
-
detachAllChildren
public void detachAllChildren()remove all children. -
getCompleteAttributes
Obtain an Attributes collection consisting of all attributes for this MessageElement, including namespace declarations.- Returns:
- Attributes collection
-
getName
get the local name of this element- Returns:
- name
-
setName
set the local part of this element's name- Parameters:
name-
-
getQName
get the fully qualified name of this element- Returns:
- a QName describing the name of thsi element
-
setQName
set the name and namespace of this element- Parameters:
qName- qualified name
-
setNamespaceURI
set the namespace URI of the element- Parameters:
nsURI- new namespace URI
-
getType
get the element's type. If we are a reference, we look up our target in the context and return (and cache) its type.- Returns:
-
setType
set the element's type- Parameters:
qname-
-
getRecorder
get the event recorder- Returns:
- recorder or null
-
setRecorder
set the event recorder- Parameters:
rec-
-
getEncodingStyle
Get the encoding style. If ours is null, walk up the hierarchy and use our parent's. Default if we're the root is "".- Specified by:
getEncodingStylein interfaceSOAPElement- Returns:
- the currently in-scope encoding style
- See Also:
-
removeContents
public void removeContents()remove all chidlren. All SOAPExceptions which can get thrown in this process are ignored.- Specified by:
removeContentsin interfaceSOAPElement
-
getVisibleNamespacePrefixes
get an iterator over visible prefixes. This includes all declared in parent elements- Specified by:
getVisibleNamespacePrefixesin interfaceSOAPElement- Returns:
- an iterator.
-
setEncodingStyle
Sets the encoding style for thisSOAPElementobject to one specified. The semantics of a null value, as above in getEncodingStyle() are to just use the parent's value, but null here means set to "".- Specified by:
setEncodingStylein interfaceSOAPElement- Parameters:
encodingStyle- aStringgiving the encoding style- Throws:
IllegalArgumentException- if there was a problem in the encoding style being set.SOAPException- See Also:
-
addChild
Note that this method will log a error and no-op if there is a value (set using setObjectValue) in the MessageElement.- Throws:
SOAPException
-
getChildren
get a list of children- Returns:
- a list, or null if there are no children
-
setContentsIndex
public void setContentsIndex(int index) set the index point of our content's starting in the event recording- Parameters:
index- index value of the first event of our recorder.
-
setNSMappings
set a new namespace mapping list- Parameters:
namespaces-
-
getPrefix
get the prefix for a given namespace URI- Parameters:
searchNamespaceURI- namespace- Returns:
- null for null or emtpy uri, null for no match, and the prefix iff there is a match
-
getNamespaceURI
map from a prefix to a namespace. Will recurse upward the element tree until we get a match- Specified by:
getNamespaceURIin interfaceSOAPElement- Parameters:
searchPrefix-- Returns:
- the prefix, or null for no match
-
getObjectValue
Returns value of the node as an object of registered type.- Returns:
- Object of proper type, or null if no mapping could be found.
-
getObjectValue
Returns value of the node as an object of registered type.- Parameters:
cls- Class that contains top level deserializer metadata- Returns:
- Object of proper type, or null if no mapping could be found.
- Throws:
Exception
-
setObjectValue
Sets value of this node to an Object. A serializer needs to be registered for this object class for proper operation.Note that this method will log an error and no-op if there are any children in the MessageElement or if the MessageElement was constructed from XML.
- Parameters:
newValue- node's value or null.- Throws:
SOAPException
-
getValueAsType
- Throws:
Exception
-
getValueAsType
This is deserialization logic mixed in to our element class. It is only valid we have a deserializer, which means that we were created usingMessageElement(String, String, String, org.xml.sax.Attributes, org.apache.axis.encoding.DeserializationContext)- Parameters:
type- type to look up a deserializer for.cls- class to use for looking up the deserializer. This takes precedence over the type field.- Returns:
- the value of the deserializer
- Throws:
Exception
-
addAttribute
add an attribute to the qname vector. This is a separate vector from the main attribute list.- Parameters:
namespace-localName-value-
-
addAttribute
add a normal CDATA/text attribute. There is no check whether or not the attribute already exists.- Parameters:
namespace- namespace URIlocalName- local anmevalue- value
-
addAttribute
add an attribute. Note that the prefix is not added to our mapping list. Also, there is no check whether or not the attribute already exists.- Parameters:
attrPrefix- prefix.namespace- namespace URIlocalName-value-
-
setAttribute
Set an attribute, adding the attribute if it isn't already present in this element, and changing the value if it is. Passing null as the value will cause any pre-existing attribute by this name to go away. -
getAttributeValue
get the value of an attribute- Parameters:
localName-- Returns:
- the value or null
-
setEnvelope
bind a a new soap envelope. sets the dirty bit.- Parameters:
env-
-
getEnvelope
get our current envelope- Returns:
- envelope or null.
-
getRealElement
get the 'real' element -will follow hrefs.- Returns:
- the message element or null if there is a href to something that is not a MessageElemeent.
-
getAsDocument
get the message element as a document. This serializes the element to a string and then parses it.- Returns:
- Throws:
Exception- See Also:
-
getAsString
get the message element as a string. This is not a cheap operation, as we have to serialise the entire message element to the current context, then convert it to a string. Nor is it cached; repeated calls repeat the operation.- Returns:
- an XML fragment in a string.
- Throws:
Exception- if anything went wrong
-
getAsDOM
create a DOM from the message element, by serializing and deserializing the element- Returns:
- the root document element of the element
- Throws:
Exception- See Also:
-
publishToHandler
replay the sax events to a handler- Parameters:
handler-- Throws:
SAXException
-
publishContents
replay the sax events to a SAX content handles- Parameters:
handler-- Throws:
SAXException
-
output
This is the public output() method, which will always simply use the recorded SAX stream for this element if it is available. If not, this method calls outputImpl() to allow subclasses and programmatically created messages to serialize themselves. -
outputImpl
override point -output to a serialization context.- Parameters:
outputContext- destination.- Throws:
Exception- if something went wrong.
-
toString
Generate a string representation by serializing our contents This is not a lightweight operation, and is repeated whenever you call this method. If the serialization fails, an error is logged and the classicObject.toString()operation invoked instead. -
addMapping
add a new namespace/prefix mapping- Parameters:
map- new mapping to add
-
addChildElement
add the child element- Specified by:
addChildElementin interfaceSOAPElement- Parameters:
childName- uri, prefix and local name of the element to add- Returns:
- the child element
- Throws:
SOAPException- See Also:
-
addChildElement
add a child element in the message element's own namespace- Specified by:
addChildElementin interfaceSOAPElement- Parameters:
localName-- Returns:
- the child element
- Throws:
SOAPException- See Also:
-
addChildElement
add a child element- Specified by:
addChildElementin interfaceSOAPElement- Parameters:
localName-prefixName-- Returns:
- the child element
- Throws:
SOAPException- See Also:
-
addChildElement
public SOAPElement addChildElement(String localName, String childPrefix, String uri) throws SOAPException add a child element- Specified by:
addChildElementin interfaceSOAPElement- Parameters:
localName-childPrefix-uri-- Returns:
- the child element
- Throws:
SOAPException- See Also:
-
addChildElement
The added child must be an instance of MessageElement rather than an abitrary SOAPElement otherwise a (wrapped) ClassCastException will be thrown.- Specified by:
addChildElementin interfaceSOAPElement- Parameters:
element- theSOAPElementto be added as a new child- Returns:
- an instance representing the new SOAP element that was actually added to the tree.
- Throws:
SOAPException- if there was an error in adding this element as a child- See Also:
-
addTextNode
add a text node to the document.- Specified by:
addTextNodein interfaceSOAPElement- Parameters:
s- aStringobject with the textual content to be added- Returns:
- ourselves
- Throws:
SOAPException- if there is an error in creating the newTextobject- See Also:
-
addAttribute
add a new attribute- Specified by:
addAttributein interfaceSOAPElement- Parameters:
attrName- name of the attributevalue- a string value- Returns:
- ourselves
- Throws:
SOAPException- See Also:
-
addNamespaceDeclaration
create aMappingmapping and add to our namespace list.- Specified by:
addNamespaceDeclarationin interfaceSOAPElement- Parameters:
prefix-uri-- Returns:
- Throws:
SOAPException- for anyRuntimeExceptioncaught- See Also:
-
getAttributeValue
Get the value of an attribute whose namespace and local name are described.- Specified by:
getAttributeValuein interfaceSOAPElement- Parameters:
attrName- qualified name of the attribute- Returns:
- the attribute or null if there was no match
- See Also:
-
getAllAttributes
Get an interator to all the attributes of the node. The iterator is over a static snapshot of the node names; if attributes are added or deleted during the iteration, this iterator will be not be updated to follow the changes.- Specified by:
getAllAttributesin interfaceSOAPElement- Returns:
- an iterator of the attributes.
- See Also:
-
getNamespacePrefixes
get an iterator of the prefixes. The iterator does not get updated in response to changes in the namespace list.- Specified by:
getNamespacePrefixesin interfaceSOAPElement- Returns:
- an iterator over a vector of prefixes
- See Also:
-
getElementName
get the full name of the element- Specified by:
getElementNamein interfaceSOAPElement- Returns:
- See Also:
-
removeAttribute
remove an element- Specified by:
removeAttributein interfaceSOAPElement- Parameters:
attrName- name of the element- Returns:
- true if the attribute was found and removed.
- See Also:
-
removeNamespaceDeclaration
remove a namespace declaration.- Specified by:
removeNamespaceDeclarationin interfaceSOAPElement- Parameters:
namespacePrefix-- Returns:
- true if the prefix was found and removed.
- See Also:
-
getChildElements
get an iterator over the children This iterator may get confused if changes are made to the children while the iteration is in progress.- Specified by:
getChildElementsin interfaceSOAPElement- Returns:
- an iterator over child elements.
- See Also:
-
getChildElement
Convenience method to get the first matching child for a given QName.- Parameters:
qname-- Returns:
- child element or null
- See Also:
-
getChildElements
get an iterator over child elements- Parameters:
qname- namespace/element name of parts to find. This iterator is not (currently) susceptible to change in the element list during its lifetime, though changes in the contents of the elements are picked up.- Returns:
- an iterator.
-
getChildElements
get an iterator over child elements- Specified by:
getChildElementsin interfaceSOAPElement- Parameters:
childName- namespace/element name of parts to find. This iterator is not (currently) susceptible to change in the element list during its lifetime, though changes in the contents of the elements are picked up.- Returns:
- an iterator.
- See Also:
-
getTagName
- Specified by:
getTagNamein interfaceElement- Returns:
- the name of the element
- See Also:
-
removeAttribute
remove a named attribute.- Specified by:
removeAttributein interfaceElement- Parameters:
attrName- name of the attributes- Throws:
DOMException- See Also:
-
hasAttribute
test for an attribute existing- Specified by:
hasAttributein interfaceElement- Parameters:
attrName- name of attribute (or null)- Returns:
- true if it exists Note that the behaviour for a null parameter (returns false) is not guaranteed in future
- See Also:
-
getAttribute
get an attribute by name- Specified by:
getAttributein interfaceElement- Parameters:
attrName- of attribute- Returns:
- the attribute value or null
- See Also:
-
removeAttributeNS
Remove an attribute. If the removed attribute has a default value it is immediately replaced. The replacing attribute has the same namespace URI and local name, as well as the original prefix. If there is no matching attribute, the operation is a no-op.- Specified by:
removeAttributeNSin interfaceElement- Parameters:
namespace- namespace of attrlocalName- local name- Throws:
DOMException- See Also:
-
setAttribute
set or update an attribute.- Specified by:
setAttributein interfaceElement- Parameters:
name- attribute namevalue- attribute value- Throws:
DOMException- See Also:
-
hasAttributeNS
Test for an attribute- Specified by:
hasAttributeNSin interfaceElement- Parameters:
namespace-localName-- Returns:
- See Also:
-
getAttributeNode
Deprecated.this is not implementedThis unimplemented operation is meand to return an attribute as a node- Specified by:
getAttributeNodein interfaceElement- Parameters:
attrName-- Returns:
- null, always.
- See Also:
-
removeAttributeNode
remove a an attribue- Specified by:
removeAttributeNodein interfaceElement- Parameters:
oldAttr-- Returns:
- oldAttr
- Throws:
DOMException
-
setAttributeNode
Deprecated.this is not implementedset the attribute node.- Specified by:
setAttributeNodein interfaceElement- Parameters:
newAttr-- Returns:
- newAttr
- Throws:
DOMException- See Also:
-
setAttributeNodeNS
set an attribute as a node- Specified by:
setAttributeNodeNSin interfaceElement- Parameters:
newAttr-- Returns:
- null
- Throws:
DOMException- See Also:
-
getElementsByTagName
- Specified by:
getElementsByTagNamein interfaceElement- Parameters:
tagName- tag to look for.- Returns:
- a list of elements
- See Also:
-
getAttributeNS
get the attribute with namespace/local name match.- Specified by:
getAttributeNSin interfaceElement- Parameters:
namespaceURI- namespacelocalName- name- Returns:
- string value or null if not found
- See Also:
-
setAttributeNS
public void setAttributeNS(String namespaceURI, String qualifiedName, String value) throws DOMException set an attribute or alter an existing one- Specified by:
setAttributeNSin interfaceElement- Parameters:
namespaceURI- namepsacequalifiedName- qualified name of the attribuevalue- value- Throws:
DOMException- See Also:
-
getAttributeNodeNS
Deprecated.not implemented!- Specified by:
getAttributeNodeNSin interfaceElement- Parameters:
namespace- namespacelocalName- local name- Returns:
- null
- See Also:
-
getElementsByTagNameNS
- Specified by:
getElementsByTagNameNSin interfaceElement- Parameters:
namespace- namespacelocalName- local name of element- Returns:
- (potentially empty) list of elements that match the (namespace,localname) tuple
- See Also:
-
getElementsNS
helper method for recusively getting the element that has namespace URI and localname- Parameters:
parentElement- parent elementnamespace- namespacelocalName- local name of element- Returns:
- (potentially empty) list of elements that match the (namespace,localname) tuple
-
item
get a child node -
getLength
public int getLength()The number of nodes in the list. The range of valid child node indices is 0 tolength-1inclusive. -
findElement
-
equals
equality test. Does a string match of the two message elements, so is fairly brute force. -
getValue
Get the value of the doc as a string. This usesgetAsDOM()so is a heavyweight operation. -
getValueDOM
-
setValue
Description copied from class:NodeImplIf 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. -
getOwnerDocument
Description copied from class:NodeImplTheDocumentobject associated with this node. This is also theDocumentobject used to create new nodes. When this node is aDocumentor aDocumentTypewhich is not used with anyDocumentyet, this isnull.- Specified by:
getOwnerDocumentin interfaceNode- Overrides:
getOwnerDocumentin classNodeImpl
-