arlut.csd.Util
Class XMLElement

java.lang.Object
  |
  +--arlut.csd.Util.XMLItem
        |
        +--arlut.csd.Util.XMLElement

public class XMLElement
extends XMLItem

Element Start class for XML data held in the XMLReader class's buffer.


Field Summary
(package private)  java.lang.String[] attrKeys
           
(package private)  java.lang.String[] attrVals
           
 XMLItem[] children
           
(package private)  boolean empty
           
(package private)  java.lang.String name
           
 
Fields inherited from class arlut.csd.Util.XMLItem
parent
 
Constructor Summary
(package private) XMLElement(java.lang.String name, org.xml.sax.AttributeList atts)
           
 
Method Summary
 void debugPrintTree(int indentLevel)
          This debug method prints out this item and all items under this item if this item is the top node in a tree.
 void dissolve()
          This method unlinks this XMLItem and any subnodes of it from each other, as well as clearing this XMLItem's parent reference.
 boolean getAttrBoolean(java.lang.String name)
          This method returns the boolean attribute value for attribute <name>, if any.
 int getAttrCount()
          This method returns the number of attributes that this element has.
 java.lang.Integer getAttrInt(java.lang.String name)
          This method returns the Integer attribute value for attribute <name>, if any.
 java.lang.String getAttrKey(int index)
          This method returns the name for a given attribute in this XMLItem.
 java.lang.String getAttrStr(java.lang.String name)
          This method returns the attribute value for attribute <name>, if any.
 java.lang.String getAttrVal(int index)
          This method returns the value for a given attribute in this XMLItem.
 XMLItem[] getChildren()
          This method returns an array of children under this item, or null if there are none.
 java.lang.String getName()
          This method returns the name of this element.
 void getTreeString(java.lang.StringBuffer buffer, int indentLevel)
          This debug method appends this item and all items under this item if this item is the top node in a tree to the StringBuffer passed in.
 boolean isEmpty()
          This method returns true if this is an empty element.
 boolean isOpen()
          This method returns true if this is an open element.
 boolean matches(java.lang.String name)
          This method returns true if this element is named <name>
 void setChildren(XMLItem[] children)
          This method sets an array of XMLItem references to be this XMLItem's children.
(package private)  void setEmpty()
          This method is called by XMLReader if the open element tag for this element is immediately matched by its close element tag.
 java.lang.String toString()
           
 
Methods inherited from class arlut.csd.Util.XMLItem
getCleanString, getParent, getString, getTreeString, matchesClose, setParent
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

children

public XMLItem[] children

name

java.lang.String name

attrKeys

java.lang.String[] attrKeys

attrVals

java.lang.String[] attrVals

empty

boolean empty
Constructor Detail

XMLElement

XMLElement(java.lang.String name,
           org.xml.sax.AttributeList atts)
Method Detail

getChildren

public XMLItem[] getChildren()

This method returns an array of children under this item, or null if there are none.

Overrides:
getChildren in class XMLItem

setChildren

public void setChildren(XMLItem[] children)

This method sets an array of XMLItem references to be this XMLItem's children.

Overrides:
setChildren in class XMLItem

dissolve

public void dissolve()

This method unlinks this XMLItem and any subnodes of it from each other, as well as clearing this XMLItem's parent reference. After this is called, children and parent will both be null-valued.

Overrides:
dissolve in class XMLItem

setEmpty

void setEmpty()

This method is called by XMLReader if the open element tag for this element is immediately matched by its close element tag.


isEmpty

public boolean isEmpty()

This method returns true if this is an empty element.

Overrides:
isEmpty in class XMLItem

isOpen

public boolean isOpen()

This method returns true if this is an open element.

Overrides:
isOpen in class XMLItem

getName

public java.lang.String getName()

This method returns the name of this element.

Overrides:
getName in class XMLItem

matches

public boolean matches(java.lang.String name)

This method returns true if this element is named <name>

Overrides:
matches in class XMLItem

getAttrCount

public int getAttrCount()

This method returns the number of attributes that this element has.

Overrides:
getAttrCount in class XMLItem

getAttrKey

public java.lang.String getAttrKey(int index)

This method returns the name for a given attribute in this XMLItem.

Overrides:
getAttrKey in class XMLItem

getAttrVal

public java.lang.String getAttrVal(int index)

This method returns the value for a given attribute in this XMLItem.

Overrides:
getAttrVal in class XMLItem

getAttrStr

public java.lang.String getAttrStr(java.lang.String name)

This method returns the attribute value for attribute <name>, if any. If this element does not contain an attribute of the given name, null is returned.

Overrides:
getAttrStr in class XMLItem

getAttrBoolean

public boolean getAttrBoolean(java.lang.String name)

This method returns the boolean attribute value for attribute <name>, if any. For Ganymede's purposes, an attribute value is true if the attribute is present with a string value of "1". If this element does not contain an attribute of the given name, false is returned.

Overrides:
getAttrBoolean in class XMLItem

getAttrInt

public java.lang.Integer getAttrInt(java.lang.String name)

This method returns the Integer attribute value for attribute <name>, if any. If this element does not contain an attribute of the given name, or if the attribute does not contain an integer value, a null value is returned.

Overrides:
getAttrInt in class XMLItem

toString

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

debugPrintTree

public void debugPrintTree(int indentLevel)

This debug method prints out this item and all items under this item if this item is the top node in a tree.

Overrides:
debugPrintTree in class XMLItem

getTreeString

public void getTreeString(java.lang.StringBuffer buffer,
                          int indentLevel)

This debug method appends this item and all items under this item if this item is the top node in a tree to the StringBuffer passed in.

Overrides:
getTreeString in class XMLItem