|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.faktorips.runtime.internal.XmlUtil
public class XmlUtil
A collection of utility methods for xml handling.
| Method Summary | |
|---|---|
static String |
getCDATAorTextContent(Node node)
Returns the node's first CDATA section if the node has one. |
static Element |
getElement(Node parent,
String tagName,
int index)
Returns the child element with the given tag name and index. |
static List<Element> |
getElementsFromNode(Element elem,
String nodeName,
String attributeName,
String attributeValue)
Returns a list of element's with the following criteria: the node name must be equals to the given node name the node must contain an attribute with the attribute name the value of the attribute (with the given name) must be equal to the given value |
static CDATASection |
getFirstCDataSection(Node node)
Returns the node's first CDATA section or null if the node hasn't got one. |
static Element |
getFirstElement(Node parent)
Returns the first Element node |
static Element |
getFirstElement(Node parent,
String tagName)
|
static Text |
getTextNode(Node node)
Returns the node's text child node or null if the node hasn't got a text node. |
static String |
getValueFromNode(Element elem,
String nodeName)
Returns the value of the first element with the given node name, starts searching by the given Element |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final Element getFirstElement(Node parent,
String tagName)
public static final Element getFirstElement(Node parent)
public static final Element getElement(Node parent,
String tagName,
int index)
parent - The parent node.tagName - the element tag name.index - The 0 based position of the child.
IndexOutOfBoundsException - if no element exists at the specified index.public static final Text getTextNode(Node node)
null if the node hasn't got a text node.
public static final CDATASection getFirstCDataSection(Node node)
null if the node hasn't got one.
public static final String getCDATAorTextContent(Node node)
null if the node hasn't got a text node.
public static final String getValueFromNode(Element elem,
String nodeName)
elem - The first element (root or parent) element the search beginsnodeName - The name searching for
public static final List<Element> getElementsFromNode(Element elem,
String nodeName,
String attributeName,
String attributeValue)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||