jrunx.util
Class DocumentElement

java.lang.Object
  |
  +--jrunx.util.DocumentElement

public class DocumentElement
extends java.lang.Object

Class that represents a single XML element. An element may contain zero or more elements

Author:
Karl Moss

Constructor Summary
DocumentElement(java.lang.String name, java.lang.String value)
          Construct a new DocumentElement
DocumentElement(java.lang.String name, java.lang.String value, java.lang.String type)
          Construct a new DocumentElement
 
Method Summary
 void addElement(DocumentElement e)
          Adds a sub-element to the list
 DocumentElement getElement(java.lang.String name)
          Returns the sub-element of the given name
 java.util.Vector getElements()
          Returns a Vector containing any sub-elements
 java.util.Vector getElements(java.lang.String name)
          Returns a Vector containing any sub-elements that have the given name
 java.lang.String getName()
          Gets the name of the element
 DocumentElement getParent()
          Gets the parent element of this element
 java.lang.String getType()
          Gets the type of the element (such as CDATA)
 java.lang.String getValue()
          Gets the value of the element
 void setParent(DocumentElement parent)
          Sets the parent element of this element
 void setValue(java.lang.String value)
          Sets the value of the element
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentElement

public DocumentElement(java.lang.String name,
                       java.lang.String value)
Construct a new DocumentElement
Parameters:
name - The element name
value - The element value

DocumentElement

public DocumentElement(java.lang.String name,
                       java.lang.String value,
                       java.lang.String type)
Construct a new DocumentElement
Parameters:
name - The element name
value - The element value
type - The element type
Method Detail

getName

public java.lang.String getName()
Gets the name of the element
Returns:
The name of the element

setValue

public void setValue(java.lang.String value)
Sets the value of the element
Parameters:
The - value of the element

getValue

public java.lang.String getValue()
Gets the value of the element
Returns:
The value of the element

getType

public java.lang.String getType()
Gets the type of the element (such as CDATA)
Returns:
The type of the element

addElement

public void addElement(DocumentElement e)
Adds a sub-element to the list
Parameters:
The - sub-element to add

getElements

public java.util.Vector getElements()
Returns a Vector containing any sub-elements
Returns:
The vector of sub-elements

getElements

public java.util.Vector getElements(java.lang.String name)
Returns a Vector containing any sub-elements that have the given name
Parameters:
name - The element name
Returns:
The vector of sub-elements

getElement

public DocumentElement getElement(java.lang.String name)
Returns the sub-element of the given name
Parameters:
name - The element name
Returns:
The element, or null if not found

setParent

public void setParent(DocumentElement parent)
Sets the parent element of this element
Parameters:
parent - The parent element

getParent

public DocumentElement getParent()
Gets the parent element of this element
Returns:
The parent element, or null for the root

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright � 2002 Macromedia Corporation. All Rights Reserved.