|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<java.lang.Object> net.sf.magicproject.xml.XmlParser.Node
public static class XmlParser.Node
XML Node. Represents an XML element with optional attributes and ordered content.
Field Summary | |
---|---|
XmlParser.Attribute[] |
aAttrs
Attributes |
boolean |
aLastString
Is the last object is a string. |
java.util.List<java.lang.Object> |
aList
Nodes |
java.lang.String |
aTag
Tag name. |
Constructor Summary | |
---|---|
XmlParser.Node(XmlParser.Node parent,
java.lang.String tag,
org.xml.sax.Attributes attrs)
Create a new instance of this class. |
Method Summary | |
---|---|
void |
add(int i,
java.lang.Object o)
|
void |
addAttribute(XmlParser.Attribute attr)
|
void |
addFirstAttribute(XmlParser.Attribute attr)
|
void |
clear()
|
boolean |
equals(java.lang.Object obj)
|
java.lang.Object |
get(int i)
Get the ith child node or content. |
XmlParser.Node |
get(java.lang.String tag)
Get the first child node with the tag. |
java.lang.String |
getAttribute(java.lang.String name)
Get an element attribute. |
java.lang.String |
getAttribute(java.lang.String name,
java.lang.String dft)
Get an element attribute. |
int |
getNbNodes()
Get the number of non text children nodes. |
java.util.List<XmlParser.Node> |
getNodes(java.lang.String tag)
Get the child nodes with the tag. |
XmlParser.Node |
getParent()
|
java.lang.String |
getTag()
|
int |
hashCode()
|
void |
print(java.io.PrintWriter printer)
Print this node using the specified printer. |
void |
removeAttribute(java.lang.String attributeName)
|
void |
removeElement(int index)
Removes the element at the specified position in this list (optional operation). |
void |
removeElement(XmlParser.Node o)
Inserts the specified element at the specified position in this list (optional operation). |
void |
setElement(int index,
java.lang.Object element)
Replaces the element at the specified position in this list with the specified element (optional operation). |
int |
size()
Get the number of children nodes. |
java.lang.String |
toString()
|
Methods inherited from class java.util.AbstractList |
---|
add, addAll, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, set, subList |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Field Detail |
---|
public java.util.List<java.lang.Object> aList
public java.lang.String aTag
public XmlParser.Attribute[] aAttrs
public boolean aLastString
Constructor Detail |
---|
public XmlParser.Node(XmlParser.Node parent, java.lang.String tag, org.xml.sax.Attributes attrs)
parent
- parent node.tag
- tag name.attrs
- attributesMethod Detail |
---|
public void addFirstAttribute(XmlParser.Attribute attr)
attr
- attribute to add.public void removeAttribute(java.lang.String attributeName)
attributeName
- the attribute to remove.public void addAttribute(XmlParser.Attribute attr)
attr
- attribute to add.public XmlParser.Node getParent()
public java.lang.String getTag()
public java.lang.String getAttribute(java.lang.String name)
name
- the attribute name.
public java.lang.String getAttribute(java.lang.String name, java.lang.String dft)
name
- the attribute name.dft
- the default value.
public int size()
size
in interface java.util.Collection<java.lang.Object>
size
in interface java.util.List<java.lang.Object>
size
in class java.util.AbstractCollection<java.lang.Object>
public int getNbNodes()
public java.lang.Object get(int i)
get
in interface java.util.List<java.lang.Object>
get
in class java.util.AbstractList<java.lang.Object>
i
- index of node.
public XmlParser.Node get(java.lang.String tag)
tag
- the tag name of node.
public java.util.List<XmlParser.Node> getNodes(java.lang.String tag)
tag
- the tag name of node.
public void add(int i, java.lang.Object o)
add
in interface java.util.List<java.lang.Object>
add
in class java.util.AbstractList<java.lang.Object>
public void removeElement(XmlParser.Node o)
This implementation always throws an UnsupportedOperationException.
o
- element to be inserted.public void removeElement(int index)
index
- the index of the element to removed.public void setElement(int index, java.lang.Object element)
index
- index of element to replace.element
- element to be stored at the specified position.public void clear()
clear
in interface java.util.Collection<java.lang.Object>
clear
in interface java.util.List<java.lang.Object>
clear
in class java.util.AbstractList<java.lang.Object>
public void print(java.io.PrintWriter printer)
printer
- used printer to add this node.public java.lang.String toString()
toString
in class java.util.AbstractCollection<java.lang.Object>
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Collection<java.lang.Object>
equals
in interface java.util.List<java.lang.Object>
equals
in class java.util.AbstractList<java.lang.Object>
public int hashCode()
hashCode
in interface java.util.Collection<java.lang.Object>
hashCode
in interface java.util.List<java.lang.Object>
hashCode
in class java.util.AbstractList<java.lang.Object>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |