|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxml.DOMHelper
public class DOMHelper
A class consisting of helper methods for dealing with DOMS.
| Constructor Summary | |
|---|---|
DOMHelper()
|
|
| Method Summary | |
|---|---|
static Element |
addTextNode(Element parent,
String text)
Adds a single text node to this element. |
static List<String> |
getStringsFromElements(List<Node> scan)
Converts a list of elements that have a text node as their first child to a list of the text values of these child nodes. |
static List<String> |
getTextElementContent(Node xml,
String tagname)
Scans the DOM for all occurences of the element with the given name. |
static List<Node> |
getTextElements(Node xml,
String tagname)
Scans the DOM for all occurrences of elements with the given tag name. |
static String |
singleAttribute(Node xml,
String tag,
String att)
Scans the node for the sole occurence of the stated element. |
static Element |
singleElement(Node xml,
String tagname)
Scans the node for the occurence of the given element. |
static String |
singleText(Node xml,
String tagname)
Scans the node for the occurrence of the given element. |
static String |
toElementName(String upper)
Converts a string into a typical element notation, thus to lower case except the starting char. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DOMHelper()
| Method Detail |
|---|
public static final String singleText(Node xml,
String tagname)
xml - Either an Element or a Documentpublic static final String toElementName(String upper)
public static final Element singleElement(Node xml,
String tagname)
public static final String singleAttribute(Node xml,
String tag,
String att)
public static final List<Node> getTextElements(Node xml,
String tagname)
public static final List<String> getStringsFromElements(List<Node> scan)
public static final List<String> getTextElementContent(Node xml,
String tagname)
getTextElements(org.w3c.dom.Node, java.lang.String) and
getStringsFromElements(java.util.List) .
public static final Element addTextNode(Element parent,
String text)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||