|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--arlut.csd.Util.XMLItem
Abstract base class for XML data held in the
XMLReader class's buffer.
This class implements stubs for most of the methods
in its subclass XMLElement, so that
the Ganymede server code can process elements without having to constantly
perform cast operations. The matches() method returns false unless this
XMLItem is actually an XMLElement with the appropriate label,
and the matchesClose() method returns false unless this XMLItem is
actually an XMLCloseElement with
the appropriate label.
| Field Summary | |
XMLItem |
parent
|
| Constructor Summary | |
XMLItem()
|
|
| 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 |
getCleanString()
This method returns the character data for this XMLItem with leading and trailing whitespace filtered out. |
java.lang.String |
getName()
This method returns the name of an element, if this is the right kind of item. |
XMLItem |
getParent()
This method returns the parent of this XMLItem, if any. |
java.lang.String |
getString()
This method returns the character data for this XMLItem. |
java.lang.String |
getTreeString()
Convenience method to get a string representation of this item and everything under it, if anything. |
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 item is an XMLElement named
<name>, false otherwise. |
boolean |
matchesClose(java.lang.String name)
This method returns true if this item is an XMLCloseElement named
<name>, false otherwise. |
void |
setChildren(XMLItem[] children)
This method sets an array of XMLItem references to be this XMLItem's children. |
void |
setParent(XMLItem parent)
This method sets this XMLItem's parent. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public XMLItem parent
| Constructor Detail |
public XMLItem()
| Method Detail |
public XMLItem getParent()
This method returns the parent of this XMLItem, if any.
public XMLItem[] getChildren()
This method returns an array of children under this item, or null if there are none.
public void setParent(XMLItem parent)
This method sets this XMLItem's parent.
public void setChildren(XMLItem[] children)
This method sets an array of XMLItem references to be this XMLItem's children.
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.
public boolean matches(java.lang.String name)
This method returns true if this item is an
XMLElement named
<name>, false otherwise.
public boolean matchesClose(java.lang.String name)
This method returns true if this item is an
XMLCloseElement named
<name>, false otherwise.
public boolean isEmpty()
This method returns true if this is an empty element.
public boolean isOpen()
This method returns true if this is an open element.
public int getAttrCount()
This method returns the number of attributes that this element has.
public java.lang.String getAttrKey(int index)
This method returns the name for a given attribute in this XMLItem.
public java.lang.String getAttrVal(int index)
This method returns the value for a given attribute in this XMLItem.
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.
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.
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.
public java.lang.String getName()
This method returns the name of an element, if this is the right kind of item.
public java.lang.String getString()
This method returns the character data for this XMLItem.
public java.lang.String getCleanString()
This method returns the character data for this XMLItem with leading and trailing whitespace filtered out.
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.
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.
public java.lang.String getTreeString()
Convenience method to get a string representation of this item and everything under it, if anything.
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||