|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectDomUtils
public final class DomUtils
This class exists simply because DOM is so inconvenient to use.
Method Summary | |
---|---|
static String |
getAttributeValue(Element element,
String name)
Retutns the value of the named attribute of the given element. |
static Element |
getChildElementByName(Element parent,
String name)
Returns the first child element with the given name. |
static List |
getChildElementsByName(Element parent,
String name)
Returns a list of child elements with the given name. |
static String |
getChildElementText(Element parent,
String name)
Returns the text value of a child element. |
static String[] |
getChildElementTextArr(Element parent,
String name)
Returns an array of text values of a child element. |
static String |
getElementText(Element element)
Returns the text value of a child element. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Element getChildElementByName(Element parent, String name)
Returns the first child element with the given name. Returns
null
if not found.
parent
- parent elementname
- name of the child element
public static List getChildElementsByName(Element parent, String name)
Returns a list of child elements with the given name. Returns an empty list if there are no such child elements.
parent
- parent elementname
- name of the child element
public static String getChildElementText(Element parent, String name)
Returns the text value of a child element. Returns
null
if there is no child element found.
parent
- parent elementname
- name of the child element
public static String getElementText(Element element)
Returns the text value of a child element. Returns
null
if there is no child element found.
element
- element
public static String[] getChildElementTextArr(Element parent, String name)
Returns an array of text values of a child element. Returns
null
if there is no child element found.
parent
- parent elementname
- name of the child element
public static String getAttributeValue(Element element, String name)
Retutns the value of the named attribute of the given element. If there is no such attribute, returns null.
element
- elementname
- name
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |