com.threed.jpct.util
Class XMLNode

java.lang.Object
  extended bycom.threed.jpct.util.XMLNode
All Implemented Interfaces:
java.io.Serializable

public final class XMLNode
extends java.lang.Object
implements java.io.Serializable

A XMLNode is a node of the tree-structure the XMLFactory builds when parsing a XML-file. A XMLNode represents a XML-tag with its attributes and data.

See Also:
Serialized Form

Method Summary
 java.util.Vector getAttributes()
          Returns the collection of attributes.
 java.lang.String getAttributeValue(java.lang.String attribute)
          Gets the value of a node's attribute or an empty String if the node doesn't have this attribute.
 java.lang.String getData()
          Returns the data of the node.
 int getLevel()
          Gets the level of the node, i.e. the depth in the tree.
 java.lang.String getName()
          Gets the name of the node.
 java.util.Vector getSubNodes()
          Returns all subnodes of this node.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getData

public java.lang.String getData()
Returns the data of the node. If the node doesn't have any data (i.e. it only has attributes or subnodes), an empty String will be returned.

Returns:
the data or an empty String

getSubNodes

public java.util.Vector getSubNodes()
Returns all subnodes of this node.

Returns:
the subnodes (a Vector of XMLNodes) or null if no subnodes exist.

getLevel

public int getLevel()
Gets the level of the node, i.e. the depth in the tree.

Returns:
the level

getName

public java.lang.String getName()
Gets the name of the node. This is the name of the tag in the XML (for example "jpct" if the tag is <jpct/>).

Returns:
the node's name

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String attribute)
Gets the value of a node's attribute or an empty String if the node doesn't have this attribute.

Parameters:
attribute - the attribute to get the value of
Returns:
the value or an empty String

getAttributes

public java.util.Vector getAttributes()
Returns the collection of attributes. This is a Vector of String[2]-arrays containing name ([0]) and value ([1]).

Returns:
the attributes