com.plumtree.openfoundation.xml.dom
Class XPElement

java.lang.Object
  extended bycom.plumtree.openfoundation.xml.dom.XPNode
      extended bycom.plumtree.openfoundation.xml.dom.XPElement

public class XPElement
extends XPNode

The XPElement class is a wrapper for objects implementing org.w3c.dom.Element interface. Please refer to Element (Java 2 Platform SE v1.4.2) for detail information.

Author:
djc

Field Summary
 
Fields inherited from class com.plumtree.openfoundation.xml.dom.XPNode
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Constructor Summary
protected XPElement(org.w3c.dom.Element currElem)
          Creates a new XPElement object.
 
Method Summary
 java.lang.String GetAttribute(java.lang.String name)
          Retrieves an attribute value by name.
 XPAttr GetAttributeNode(java.lang.String name)
          Retrieves an attribute node by name.
 XPAttr GetAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)
          Retrieves a XPAttr node by local name and namespace URI.
 java.lang.String GetAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
          Retrieves an attribute value by local name and namespace URI.
 XPNodeList GetElementsByTagName(java.lang.String name)
          Returns a XPNodeList of all descendant XPElements with a given tag name, in the order in which they are encountered in a preorder traversal of this XPElement tree.
 XPNodeList GetElementsByTagNameNS(java.lang.String namespaceURI, java.lang.String localName)
          Returns a XPNodeList of all the descendant XPElements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this XPElement tree.
 java.lang.String GetTagName()
          The name of the element.
 org.w3c.dom.Node GetUnderlyingObject()
          Retrieve the underlying org.w3c.dom.Node object.
 boolean HasAttribute(java.lang.String name)
          Returns true when an attribute with a given name is specified on this element or has a default value, false otherwise.
 boolean HasAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
          Returns true when an attribute with a given local name and namespace URI is specified on this element or has a default value, false otherwise.
 void RemoveAttributeNode(java.lang.String name)
          Removes the specified attribute node.
 void RemoveAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
          Removes an attribute by local name and namespace URI.
 void SetAttribute(java.lang.String name, java.lang.String value)
          Adds a new attribute.
 XPAttr SetAttributeNode(XPAttr newAttr)
          Adds a new attribute node.
 XPAttr SetAttributeNodeNS(XPAttr newAttr)
          Adds a new attribute.
 void SetAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String newValue)
          Adds a new attribute.
 
Methods inherited from class com.plumtree.openfoundation.xml.dom.XPNode
AppendChild, CloneNode, GetAttributes, GetChildNodes, GetFirstChild, GetLastChild, GetLocalName, GetNamespaceURI, GetNextSibling, GetNodeName, GetNodeType, GetNodeValue, GetOwnerDocument, GetParentNode, GetPrefix, GetPreviousSibling, HasAttributes, HasChildNodes, InsertBefore, IsAttributeNode, IsCDATASectionNode, IsCommentNode, IsDocumentFragmentNode, IsDocumentNode, IsDocumentTypeNode, IsElementNode, IsProcessingInstructionNode, IsSupported, IsTextNode, Normalize, RemoveChild, ReplaceChild, SetNodeValue, SetPrefix, StoreNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPElement

protected XPElement(org.w3c.dom.Element currElem)
Creates a new XPElement object.

Parameters:
currElem - - underlying element node
Method Detail

GetAttribute

public java.lang.String GetAttribute(java.lang.String name)
Retrieves an attribute value by name.

Parameters:
name - - attribute name to be searched
Returns:
the element's attribute

GetAttributeNS

public java.lang.String GetAttributeNS(java.lang.String namespaceURI,
                                       java.lang.String localName)
Retrieves an attribute value by local name and namespace URI.

Parameters:
namespaceURI - - namespace in which to look
localName - - name of desired attribute
Returns:
attribute with the namespace

GetAttributeNode

public XPAttr GetAttributeNode(java.lang.String name)
Retrieves an attribute node by name.

Parameters:
name - - name of desired attribute
Returns:
attribute node given a name

GetAttributeNodeNS

public XPAttr GetAttributeNodeNS(java.lang.String namespaceURI,
                                 java.lang.String localName)
Retrieves a XPAttr node by local name and namespace URI.

Parameters:
namespaceURI - - namespace of desired attribute
localName - - name of desired attribute
Returns:
attribute node given name and namespace

GetElementsByTagName

public XPNodeList GetElementsByTagName(java.lang.String name)
Returns a XPNodeList of all descendant XPElements with a given tag name, in the order in which they are encountered in a preorder traversal of this XPElement tree.

Parameters:
name - - name of desired element(s)
Returns:
elements by the given name

GetElementsByTagNameNS

public XPNodeList GetElementsByTagNameNS(java.lang.String namespaceURI,
                                         java.lang.String localName)
Returns a XPNodeList of all the descendant XPElements with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of this XPElement tree.

Parameters:
namespaceURI - - namespace of desired element(s)
localName - - name of desired element(s)
Returns:
elements by the given name and in the namespace

GetTagName

public java.lang.String GetTagName()
The name of the element.

Returns:
the elements name

GetUnderlyingObject

public org.w3c.dom.Node GetUnderlyingObject()
Description copied from class: XPNode
Retrieve the underlying org.w3c.dom.Node object.

Overrides:
GetUnderlyingObject in class XPNode
Returns:
the underlying element

HasAttribute

public boolean HasAttribute(java.lang.String name)
Returns true when an attribute with a given name is specified on this element or has a default value, false otherwise.

Parameters:
name - - name of attr
Returns:
does the element have an attribute by the given name

HasAttributeNS

public boolean HasAttributeNS(java.lang.String namespaceURI,
                              java.lang.String localName)
Returns true when an attribute with a given local name and namespace URI is specified on this element or has a default value, false otherwise.

Parameters:
namespaceURI - - namespace of attribute.
localName - - name of attribute.
Returns:
true if an attribute with the given local name and namespace URI is specified or has a default value on this element, false otherwise.

RemoveAttributeNS

public void RemoveAttributeNS(java.lang.String namespaceURI,
                              java.lang.String localName)
Removes an attribute by local name and namespace URI.

Parameters:
namespaceURI - - namespace of attr
localName - - name of attr

RemoveAttributeNode

public void RemoveAttributeNode(java.lang.String name)
Removes the specified attribute node.

Parameters:
name - - name of attribute to be removed.

SetAttribute

public void SetAttribute(java.lang.String name,
                         java.lang.String value)
Adds a new attribute.

Parameters:
name - - name of attr
value - - value of attr

SetAttributeNS

public void SetAttributeNS(java.lang.String namespaceURI,
                           java.lang.String qualifiedName,
                           java.lang.String newValue)
Adds a new attribute.

Parameters:
namespaceURI - - namespace of attr
qualifiedName - - name of attr
newValue - - value of attr

SetAttributeNode

public XPAttr SetAttributeNode(XPAttr newAttr)
Adds a new attribute node.

Parameters:
newAttr - - attr to be set
Returns:
the attribute that was set by newAttr.

SetAttributeNodeNS

public XPAttr SetAttributeNodeNS(XPAttr newAttr)
Adds a new attribute.

Parameters:
newAttr - - attr to be set
Returns:
the attribute that was set by newAttr.


Copyright © 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.