public interface Element extends Node
Modifier and Type | Method and Description |
---|---|
void |
addContent(Element childNode)
Add the child node to this node.
|
java.lang.Object |
clone()
Return a deep copy of this node, including copies of all sub-nodes.
|
java.util.List<Attribute> |
getAttributeList()
Get the list of attributes of this element.
|
java.lang.String |
getAttributeValue(java.lang.String attrName)
Get the value of the specified attribute.
|
Element |
getElementChildAtIndex(int index)
Returns the child at a specific index.
|
java.lang.String |
getText()
Get the text value of the element.
|
void |
removeAttribute(java.lang.String attrName)
Remove the attribute with the specified name.
|
void |
setAttribute(java.lang.String attrName,
java.lang.String attrValue)
Add a new attribute and set its value.
|
void |
setText(java.lang.String theText)
Set the text value of the element.
|
addChild, addContent, addContent, detach, getChild, getChildren, getChildrenCount, getName, getValue, hasChildren, removeChild, setName, setValue
void setAttribute(java.lang.String attrName, java.lang.String attrValue)
attrName
- the name of the attribute.attrValue
- the attribute value.java.util.List<Attribute> getAttributeList()
java.lang.String getAttributeValue(java.lang.String attrName)
attrName
- the attribute name.void removeAttribute(java.lang.String attrName)
attrName
- the attribute name.void setText(java.lang.String theText)
theText
- the value of a text element.java.lang.String getText()
Element getElementChildAtIndex(int index) throws java.lang.Exception
index
- the index of the childjava.lang.Exception
- any error.void addContent(Element childNode)
childNode
- the node to add as a child node.