com.nwoods.jgo.svg
Class AbstractNode

java.lang.Object
  extended bycom.nwoods.jgo.svg.AbstractNode
All Implemented Interfaces:
DomNode
Direct Known Subclasses:
DefaultCDATASection, DefaultElement, DefaultText

public class AbstractNode
extends java.lang.Object
implements DomNode

A wrapper class for org.w3c.dom.Node. By implementing the interface DomNode, this class allows the com.nwoods.jgo package to provide methods that manipulate org.w3c.dom.Node objects while not requiring the org.w3c.dom.Node class to be present in order to build com.nwoods.jgo. JGo applications that support serialization to and from SVG XML files require this class.


Constructor Summary
AbstractNode(org.w3c.dom.Node node)
          Create a new AbstractNode
 
Method Summary
 DomNode appendChild(DomNode nodeToAppend)
          Adds the node newChild to the end of the list of children of this node.
 DomElement elementCast()
          Casts this DomNode to a DomElement.
 DomNode getFirstChild()
          Get the first child node.
 DomElement getFirstChildElement()
          Get the first child DomElement of this node.
 DomText getFirstChildText()
          Get the first child DomText of this node.
 DomNode getNextSibling()
          Get the first sibling of this node.
 DomElement getNextSiblingElement()
          Get the first sibling DomElement of this node.
 DomElement getNextSiblingJGoClassElement()
          Get the first sibling JGoClass ComElement of this node.
 DomText getNextSiblingText()
          Get the first sibling DomText of this node.
 org.w3c.dom.Node getNode()
          Return the org.w3c.dom.Node associated with this AbstractNode
 DomNode getParentNode()
          Get the parent of this node.
 boolean isElement()
          Tests if this DomNode is a DomElement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractNode

public AbstractNode(org.w3c.dom.Node node)
Create a new AbstractNode

Parameters:
node - a org.w3c.dom.Node object
Method Detail

getNode

public org.w3c.dom.Node getNode()
Return the org.w3c.dom.Node associated with this AbstractNode

Returns:
the the org.w3c.dom.Node associated with this AbstractNode

appendChild

public DomNode appendChild(DomNode nodeToAppend)
Description copied from interface: DomNode
Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed.

Specified by:
appendChild in interface DomNode
Parameters:
nodeToAppend - the node being appended
Returns:
the node added

isElement

public boolean isElement()
Description copied from interface: DomNode
Tests if this DomNode is a DomElement.

Specified by:
isElement in interface DomNode
Returns:
true if the DomNode is a DomElement

elementCast

public DomElement elementCast()
Description copied from interface: DomNode
Casts this DomNode to a DomElement.

Specified by:
elementCast in interface DomNode
Returns:
the DomElement if the the DomNode is a DomElement. Returns null otherwise.

getFirstChild

public DomNode getFirstChild()
Description copied from interface: DomNode
Get the first child node.

Specified by:
getFirstChild in interface DomNode
Returns:
the first child of this node. If there is no such node, this returns null.

getFirstChildElement

public DomElement getFirstChildElement()
Description copied from interface: DomNode
Get the first child DomElement of this node.

Specified by:
getFirstChildElement in interface DomNode
Returns:
the first child DomElement of this node. If there is no such DomElement, this returns null.

getFirstChildText

public DomText getFirstChildText()
Description copied from interface: DomNode
Get the first child DomText of this node.

Specified by:
getFirstChildText in interface DomNode
Returns:
the first child DomText of this node. If there is no such DomText, this returns null.

getParentNode

public DomNode getParentNode()
Description copied from interface: DomNode
Get the parent of this node.

Specified by:
getParentNode in interface DomNode
Returns:
the first parent of this node. If there is no parent, this returns null.

getNextSibling

public DomNode getNextSibling()
Description copied from interface: DomNode
Get the first sibling of this node.

Specified by:
getNextSibling in interface DomNode
Returns:
the first sibling of this node. If there is no such sibling, this returns null.

getNextSiblingElement

public DomElement getNextSiblingElement()
Description copied from interface: DomNode
Get the first sibling DomElement of this node.

Specified by:
getNextSiblingElement in interface DomNode
Returns:
the first sibling DomElement of this node. If there is no such sibling, this returns null.

getNextSiblingJGoClassElement

public DomElement getNextSiblingJGoClassElement()
Description copied from interface: DomNode
Get the first sibling JGoClass ComElement of this node.

Specified by:
getNextSiblingJGoClassElement in interface DomNode
Returns:
the first sibling DomElement of this node. If there is no such sibling, this returns null.

getNextSiblingText

public DomText getNextSiblingText()
Description copied from interface: DomNode
Get the first sibling DomText of this node.

Specified by:
getNextSiblingText in interface DomNode
Returns:
the first sibling DomText of this node. If there is no such sibling, this returns null.