public class XMLElement
extends java.lang.Object
XMLElement
s and a parent XMLElement
.Constructor and Description |
---|
XMLElement() |
Modifier and Type | Method and Description |
---|---|
java.util.HashMap<java.lang.String,java.lang.String> |
getAttributes() |
java.util.Vector<XMLElement> |
getChildren() |
XMLElement[] |
getChildren(java.lang.String name)
Returns the an array of found child with given name.
|
java.lang.String |
getName() |
XMLElement |
getParent() |
void |
print()
Prints the
XMLElement to the console in the following manner:name [attribute=value] [2ndAttribute=2ndValue] \r\n |
void |
printXMLTree()
Prints the
XMLElement 's whole XML-tree to the console in the
following manner:name [attribute=value] [2ndAttribute=2ndValue] \r\n |
void |
setName(java.lang.String name)
Sets the
XMLElement 's name. |
void |
setParent(XMLElement parent)
Sets the
XMLElement 's parent XMLElement . |
public java.lang.String getName()
XMLElement
's name.public void setName(java.lang.String name)
XMLElement
's name.parent
- the name to be set.public java.util.HashMap<java.lang.String,java.lang.String> getAttributes()
XMLElement
's attributes as a HashMap
containing the attributes' names as keys and the values as
values.public java.util.Vector<XMLElement> getChildren()
XMLElement
's children in a Vector
.public XMLElement getParent()
XMLElement
's parent XMLElement
.public void setParent(XMLElement parent)
XMLElement
's parent XMLElement
.parent
- the XMLElement
to be set.public void print()
XMLElement
to the console in the following manner:name [attribute=value] [2ndAttribute=2ndValue] \r\n
public void printXMLTree()
XMLElement
's whole XML-tree to the console in the
following manner:name [attribute=value] [2ndAttribute=2ndValue] \r\n
\t1stChildName [3rdAttribute=3rdValue] \r\n
\t2ndChildName \r\n
\t\t2ndChildsChildName [4thAttribute=4thValue] \r\n
public XMLElement[] getChildren(java.lang.String name)
name
- Name of the children to return.XMLElement
s.