|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.util.XMLSimple.Element
Simple representation of an XML Element. Has a name, a HashMap of attrs, and an ArrayList of children. The attrs list may be empty, but not null. The keys and values are the names and values of the attributes (both Strings).
The ArrayList of children may also be empty, but not null. The child list elements are also Elements.
Constructor Summary | |
XMLSimple.Element(java.lang.String name)
Constructs a new Element |
Method Summary | |
void |
addChild(XMLSimple.Element child)
Adds a child to the list. |
java.util.HashMap |
getAttrs()
Returns the attributes map for this Element. |
java.util.ArrayList |
getChildren()
Returns a list of the child elements of this element. |
XMLSimple.Element[] |
getElements()
Returns the children as an array. |
java.lang.String |
getName()
Returns the name of this element. |
XMLParams |
toParams()
Most of the XML requests for the client/server protocol are a "request" element with nested "param" elements, each with "name" and "value" attributes. |
java.lang.String |
toString()
Returns debugging representation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public XMLSimple.Element(java.lang.String name)
Method Detail |
public java.util.HashMap getAttrs()
public java.lang.String getName()
public java.util.ArrayList getChildren()
public XMLSimple.Element[] getElements()
public void addChild(XMLSimple.Element child)
public java.lang.String toString()
public XMLParams toParams()
Example: a request element with one param child, <param> name="op" value="play"/>, would return a hash with the key "op" and the value "play".
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |