|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.roarsoftware.xml.DomElement
public class DomElement
DomElement
wraps around an Element
and provides convenience methods.
Constructor Summary | |
---|---|
DomElement(org.w3c.dom.Element elem)
Creates a new wrapper around the given Element . |
Method Summary | |
---|---|
java.lang.String |
getAttribute(java.lang.String name)
Returns the attribute value to a given attribute name or null if the attribute doesn't exist. |
DomElement |
getChild(java.lang.String name)
Returns the child element with the given name or null if it doesn't exist. |
java.util.Collection<DomElement> |
getChildren()
|
java.util.Collection<DomElement> |
getChildren(java.lang.String name)
Returns all children of this element with the given tag name. |
java.lang.String |
getChildText(java.lang.String name)
Returns the text content of a child node with the given name. |
org.w3c.dom.Element |
getElement()
|
java.lang.String |
getTagName()
Returns this element's tag name. |
java.lang.String |
getText()
|
boolean |
hasChild(java.lang.String name)
Checks if this element has a child element with the given name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DomElement(org.w3c.dom.Element elem)
Element
.
elem
- An w3c ElementMethod Detail |
---|
public org.w3c.dom.Element getElement()
public java.lang.String getAttribute(java.lang.String name)
null
if the attribute doesn't exist.
name
- The attribute's name
null
public java.lang.String getText()
public boolean hasChild(java.lang.String name)
name
- The child's name
true
if this element has a child element with the given namepublic DomElement getChild(java.lang.String name)
null
if it doesn't exist.
name
- The child's name
null
public java.lang.String getChildText(java.lang.String name)
null
is returned.
name
- The child's name
null
public java.util.Collection<DomElement> getChildren()
public java.util.Collection<DomElement> getChildren(java.lang.String name)
name
- The children's tag name
public java.lang.String getTagName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |