com.sunwesttek.xml
Class SimpleDOMElement

java.lang.Object
  |
  +--com.sunwesttek.xml.SimpleDOMElement
All Implemented Interfaces:
DOMElement

public class SimpleDOMElement
extends java.lang.Object
implements DOMElement

SimpleDOMElement is a highly-simplified XML DOM element implementation.


Constructor Summary
SimpleDOMElement(java.lang.String tagName)
          Construct a SimpleDOMElement with specified tag name.
 
Method Summary
 void addChildElement(DOMElement element)
          Add an element as a child of the current element.
 java.lang.String getAttribute(java.lang.String name)
          Get the value of the attribute with specified name.
 java.util.List getChildElements()
          Get all the child elements of the current element.
 java.util.List getChildElementsByTagName(java.lang.String tagName)
          Get all the child elements of the current element with specified tag name.
 java.lang.String getTagName()
          Get the tag name of the element.
 java.lang.String getText()
          Get the text of the element.
 void setAttribute(java.lang.String name, java.lang.String value)
          Add/replace the value of the attribute with specified name.
 void setTagName(java.lang.String tagName)
          Set the tag name of the element.
 void setText(java.lang.String text)
          Set the text of the element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleDOMElement

public SimpleDOMElement(java.lang.String tagName)
Construct a SimpleDOMElement with specified tag name.

Parameters:
tagName - Tag name
Method Detail

getTagName

public java.lang.String getTagName()
Get the tag name of the element.

Specified by:
getTagName in interface DOMElement
Returns:
Tag name

setTagName

public void setTagName(java.lang.String tagName)
Set the tag name of the element.

Parameters:
tagName - Tag name

getText

public java.lang.String getText()
Get the text of the element.

Specified by:
getText in interface DOMElement
Returns:
Text of the element

setText

public void setText(java.lang.String text)
Set the text of the element.

Parameters:
text - Text

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Get the value of the attribute with specified name.

Specified by:
getAttribute in interface DOMElement
Parameters:
name - Attribute name
Returns:
Attribute value or null if no such attribute is found

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
Add/replace the value of the attribute with specified name.

Parameters:
name - Attribute name
value - Attribute value

addChildElement

public void addChildElement(DOMElement element)
Add an element as a child of the current element.

Parameters:
element - Child element

getChildElements

public java.util.List getChildElements()
Get all the child elements of the current element.

Specified by:
getChildElements in interface DOMElement
Returns:
Child elements of the current element

getChildElementsByTagName

public java.util.List getChildElementsByTagName(java.lang.String tagName)
Get all the child elements of the current element with specified tag name.

Specified by:
getChildElementsByTagName in interface DOMElement
Parameters:
tagName - Tag name
Returns:
Child elements of the current element with specified tag name


Copyright (c) 2002 Sunwest Technologies. http://www.SunwestTek.com/