Class BasicElement

java.lang.Object
  |
  +--BasicElement
Direct Known Subclasses:
DBSAXElement, ReaderElement

public class BasicElement
extends java.lang.Object

A Class that represents an XML element and its contents


Constructor Summary
BasicElement()
          Construct a Basic Element
BasicElement(long element_id, java.lang.String tagname, long parent_id)
          Construct a Basic Element
BasicElement(java.lang.String tagname, long parent_id)
          Construct a Basic Element
 
Method Summary
 void appendContent(char[] cbuf, int start, int len)
          Append to the content of the element
 void appendContent(java.lang.String new_content)
          Append to the content of the element
 java.lang.String getAttribute(java.lang.String attName)
          Get an attribute value by name
 java.lang.String getAttributes()
          Get the attributes as a string
 java.lang.String getContent()
          Get the content of the element
 long getElementID()
          Get the id of this element
 long getParentID()
          Get the parent id of this element
 java.lang.String getTagName()
          Get the name of this element
 void setAttribute(java.lang.String attName, java.lang.String attValue)
          Add a new attribute to this element, or set its value
 void setElementID(long element_id)
          Set the id of this element
 void setParentID(long parent_id)
          Set the parent id of this element
 void setTagName(java.lang.String tagname)
          Set the tagname of this element
 java.lang.String toString()
          convert the element to a string representation for display
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicElement

public BasicElement()
Construct a Basic Element

BasicElement

public BasicElement(java.lang.String tagname,
                    long parent_id)
Construct a Basic Element
Parameters:
tagname - the name of the element
parent_id - the id number of the parent element

BasicElement

public BasicElement(long element_id,
                    java.lang.String tagname,
                    long parent_id)
Construct a Basic Element
Parameters:
element_id - the id number of the element
tagname - the name of the element
parent_id - the id number of the parent element
Method Detail

toString

public java.lang.String toString()
convert the element to a string representation for display
Overrides:
toString in class java.lang.Object

getElementID

public long getElementID()
Get the id of this element

setElementID

public void setElementID(long element_id)
Set the id of this element

getParentID

public long getParentID()
Get the parent id of this element

setParentID

public void setParentID(long parent_id)
Set the parent id of this element

getTagName

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

setTagName

public void setTagName(java.lang.String tagname)
Set the tagname of this element

getAttributes

public java.lang.String getAttributes()
Get the attributes as a string

setAttribute

public void setAttribute(java.lang.String attName,
                         java.lang.String attValue)
Add a new attribute to this element, or set its value

getAttribute

public java.lang.String getAttribute(java.lang.String attName)
Get an attribute value by name

appendContent

public void appendContent(char[] cbuf,
                          int start,
                          int len)
Append to the content of the element

appendContent

public void appendContent(java.lang.String new_content)
Append to the content of the element

getContent

public java.lang.String getContent()
Get the content of the element