|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.umass.xml.DomElement
public class DomElement
DomElement wraps around an Element and provides convenience methods.
| Constructor Summary | |
|---|---|
DomElement(Element elem)
Creates a new wrapper around the given Element. |
|
| Method Summary | |
|---|---|
String |
getAttribute(String name)
Returns the attribute value to a given attribute name or null if the attribute doesn't exist. |
DomElement |
getChild(String name)
Returns the child element with the given name or null if it doesn't exist. |
List<DomElement> |
getChildren()
|
List<DomElement> |
getChildren(String name)
Returns all children of this element with the given tag name. |
String |
getChildText(String name)
Returns the text content of a child node with the given name. |
Element |
getElement()
|
String |
getTagName()
Returns this element's tag name. |
String |
getText()
|
boolean |
hasAttribute(String name)
Tests if this element has an attribute with the specified name. |
boolean |
hasChild(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(Element elem)
Element.
elem - An w3c Element| Method Detail |
|---|
public Element getElement()
public boolean hasAttribute(String name)
name - Name of the attribute.
true if this element has an attribute with the specified name.public String getAttribute(String name)
null if the attribute doesn't exist.
name - The attribute's name
nullpublic String getText()
public boolean hasChild(String name)
name - The child's name
true if this element has a child element with the given namepublic DomElement getChild(String name)
null if it doesn't exist.
name - The child's name
nullpublic String getChildText(String name)
null is returned.
name - The child's name
nullpublic List<DomElement> getChildren()
public List<DomElement> getChildren(String name)
name - The children's tag name
public String getTagName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||