|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.swing.junit.xml.XmlNode
public class XmlNode
Understands a DOM-based XML element. This class is intended for internal use only. It is just a thin wrapper around
a DOM
. It only provides the necessary functionality needed by the FEST-Swing JUnit
extension.
Element
Constructor Summary | |
---|---|
protected |
XmlNode(Element target)
Creates a new XmlNode . |
Method Summary | |
---|---|
void |
addAttribute(XmlAttribute a)
Adds an attribute to this node. |
void |
addAttributes(XmlAttribute... attributes)
Adds one or more attributes to this node. |
void |
addCdata(String data)
Adds a CDATA section to this node. |
XmlNode |
addNewNode(String name)
Creates and adds a new XML node to this node. |
XmlNode |
addNewNode(String name,
XmlAttributes attributes)
Creates and adds a new XML node to this node. |
void |
addText(String text)
Adds a text node to this node. |
int |
attributeCount()
Returns the number of attributes in this node. |
XmlNode |
child(int index)
Returns the child at the given index. |
boolean |
equals(Object obj)
|
int |
hashCode()
|
String |
name()
Returns the name of this node. |
XmlNode |
parentNode()
Returns the parent node of this node. |
int |
size()
Returns the number of children in this node. |
Element |
target()
Returns the underlying DOM . |
String |
text()
Returns the text content of this node. |
String |
toString()
|
String |
valueOfAttribute(String name)
Returns the value of the given attribute, or an empty String if this node does not contain an
attribute with the given name. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected XmlNode(Element target)
XmlNode
.
target
- the underlying DOM element.Method Detail |
---|
public XmlNode addNewNode(String name)
name
- the name of the node to add.
public XmlNode addNewNode(String name, XmlAttributes attributes)
name
- the name of the node to add.attributes
- the attributes of the node to add.
public void addCdata(String data)
data
- the data for the CDATA section to create.public void addText(String text)
text
- the text of the new text node.public void addAttribute(XmlAttribute a)
a
- the attribute to add.public void addAttributes(XmlAttribute... attributes)
attributes
- the attribute(s) to add to this node.public Element target()
Element
.
public XmlNode parentNode()
public int size()
public XmlNode child(int index)
index
- the given index.
public String valueOfAttribute(String name)
String
if this node does not contain an
attribute with the given name.
name
- the name of the attribute we are looking for.
String
if this node does not
contain a matching attribute.public String name()
public String text()
public int attributeCount()
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |