Class Element
java.lang.Object
org.castor.xmlctf.xmldiff.xml.nodes.XMLNode
org.castor.xmlctf.xmldiff.xml.nodes.ParentNode
org.castor.xmlctf.xmldiff.xml.nodes.Element
A representation of an Element XML node.
- Since:
- Castor 1.1
- Version:
- $Revision: 0000 $ $Date: 2007-01-11 00:00:00 -0600 (Thu, 11 Jan 2007) $
- Author:
- Edward Kuns
-
Field Summary
Fields inherited from class XMLNode
ATTRIBUTE, ELEMENT, PROCESSING_INSTRUCTION, ROOT, TEXTModifier and TypeFieldDescriptionstatic final intNode is an attribute.static final intNode is an element.static final intNode is a processing instruction.static final intNode is a root node.static final intNode is a text node. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(Attribute attr) Adds the given Attribute to this Element.voidaddNamespace(Namespace namespace) Adds the given Namespace to this Element.getAttribute(String uri, String localName) Returns the value of the named attribute, or null if the node has no such attribute.Returns an Iterator over the List of Attributes.Returns the location of this Element in the document.getNamespacePrefix(String uri) Returns the namespace prefix associated with this namespace URI, as defined in the context of this node.getNamespaceURI(String prefix) Returns the namespace URI associated with this namespace prefix, as defined in the context of this node.voidsetLocation(Location location) Sets the location of this Element in the document.Methods inherited from class ParentNode
addChild, getChildIterator, getStringValue, hasChildNodesModifier and TypeMethodDescriptionvoidAdds the given child node to this ParentNode.Returns an Iterator over the list of child nodes.Returns the string value of this parent node.booleanReturns true if this node has any child nodes.Methods inherited from class XMLNode
getLocalName, getNamespaceURI, getNodeLocation, getNodeType, getParentNode, getRootNode, getXPath, setNamespaceModifier and TypeMethodDescriptionReturns the local name of the node.Returns the namespace URI the node.Finds and returns the location of this node in its root's tree.final intReturns the type of this node.Returns the parent node, or null if the node has no parent.Returns the root node.protected StringgetXPath()Returns the XPath from the root node to this node.voidsetNamespace(String namespace) Sets the namespace URI for this XMLNode.
-
Constructor Details
-
Element
-
-
Method Details
-
getAttributeIterator
Returns an Iterator over the List of Attributes.- Returns:
- an Iterator over the List of Attributes.
-
getAttribute
Returns the value of the named attribute, or null if the node has no such attribute. If the argument uri is null, the node's namespace URI will be used.- Parameters:
uri- The attribute's namespace URI, or nulllocalName- The attribute's local name- Returns:
- The attribute's value, or null if no such attribute exists
-
getNamespaceURI
Returns the namespace URI associated with this namespace prefix, as defined in the context of this node. Returns null if the prefix is undefined. Returns an empty String if the prefix is defined and associated with no namespace.- Overrides:
getNamespaceURIin classXMLNode- Parameters:
prefix- The namespace prefix- Returns:
- The namespace URI, or null.
-
getNamespacePrefix
Returns the namespace prefix associated with this namespace URI, as defined in the context of this node. Returns null if no prefix is defined for this namespace URI. Returns an empty string if the default prefix is associated with this namespace URI.- Parameters:
uri- The namespace URI- Returns:
- The namespace prefix, or null
-
addAttribute
Adds the given Attribute to this Element.- Parameters:
attr- the Attribute to add
-
addNamespace
Adds the given Namespace to this Element.- Parameters:
namespace- the Namespace to add
-
setLocation
Sets the location of this Element in the document.- Parameters:
location- the location of this Element in the document.
-
getLocation
Returns the location of this Element in the document.- Returns:
- the location of this Element in the document.
-