org.castor.xmlctf.xmldiff.xml.nodes

Class ParentNode

Known Direct Subclasses:
Element, Root

public abstract class ParentNode
extends XMLNode

The base object for both Element and RootNode. The children of a ParentNode can be any type of XMLNode.
Version:
$Revision: 0000 $ $Date: 2007-01-11 00:00:00 -0600 (Thu, 11 Jan 2007) $
Author:
Edward Kuns
Since:
Castor 1.1

Field Summary

Fields inherited from class org.castor.xmlctf.xmldiff.xml.nodes.XMLNode

ATTRIBUTE, ELEMENT, PROCESSING_INSTRUCTION, ROOT, TEXT

Constructor Summary

ParentNode(String namespace, String localName, int nodeType)
Creates a new ParentNode.

Method Summary

void
addChild(XMLNode node)
Adds the given child node to this ParentNode.
Iterator
getChildIterator()
Returns an Iterator over the list of child nodes.
String
getStringValue()
Returns the string value of this parent node.
boolean
hasChildNodes()
Returns true if this node has any child nodes.

Methods inherited from class org.castor.xmlctf.xmldiff.xml.nodes.XMLNode

getLocalName, getNamespaceURI, getNamespaceURI, getNodeLocation, getNodeType, getParentNode, getRootNode, getStringValue, getXPath, setNamespace, setParent

Constructor Details

ParentNode

(package private)  ParentNode(String namespace,
                              String localName,
                              int nodeType)
Creates a new ParentNode.
Parameters:
namespace - the namespace URI for this node. (May be null.)
localName - the local-name of this node. (Cannot be null.)
nodeType - the node type being created

Method Details

addChild

public void addChild(XMLNode node)
Adds the given child node to this ParentNode.
Parameters:
node - the child node to add

getChildIterator

public Iterator getChildIterator()
Returns an Iterator over the list of child nodes.
Returns:
an Iterator over the list of child nodes.

getStringValue

public String getStringValue()
Returns the string value of this parent node. The string value is the concatenation of the string value of all child nodes.
Overrides:
getStringValue in interface XMLNode
Returns:
The string value of the node

hasChildNodes

public boolean hasChildNodes()
Returns true if this node has any child nodes.
Returns:
True if this node has any child nodes.

Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com