|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jodd.util.XmlUtil
public class XmlUtil
Some XML and XPath utilities.
Constructor Summary | |
---|---|
XmlUtil()
|
Method Summary | |
---|---|
static java.util.List |
filterNodeList(org.w3c.dom.NodeList nodeList,
short keepNodeType)
Filters node list by keeping nodes of specified type. |
static java.util.List<org.w3c.dom.Node> |
filterNodeList(org.w3c.dom.NodeList nodeList,
short keepNodeType,
java.lang.String nodeName)
Filters node list by keeping nodes of specified type and node name. |
static java.util.List |
filterNodeListElements(org.w3c.dom.NodeList nodeList)
Filter node list for all Element nodes. |
static java.util.List<org.w3c.dom.Node> |
filterNodeListElements(org.w3c.dom.NodeList nodeList,
java.lang.String nodeName)
Filter node list for Element nodes of specified name. |
static java.util.Map<java.lang.String,java.lang.String> |
getAllAttributes(org.w3c.dom.Node node)
Returns a map of all node's attributes. |
static java.lang.String |
getAttributeValue(org.w3c.dom.Element element,
java.lang.String name)
Get element's attribute value or null if attribute not found or empty. |
static java.lang.String |
getAttributeValue(org.w3c.dom.Node node,
java.lang.String attrName)
Returns attribute value of a node or null if attribute name not found. |
static java.util.List |
getChildElements(org.w3c.dom.Node node)
Returns a list of all child Elements, |
static java.util.List |
getChildElements(org.w3c.dom.Node node,
java.lang.String nodeName)
Returns a list of child Elements of specified name. |
static java.lang.String |
getChildTextNodeValue(org.w3c.dom.Node node)
Returns value of single child text node or null . |
static java.lang.String |
getFirstChildTextNodeValue(org.w3c.dom.Node node)
Returns value of first available child text node or null if not found. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlUtil()
Method Detail |
---|
public static java.util.Map<java.lang.String,java.lang.String> getAllAttributes(org.w3c.dom.Node node)
public static java.lang.String getAttributeValue(org.w3c.dom.Node node, java.lang.String attrName)
null
if attribute name not found.
Specified attribute is searched on every call.
Consider getAllAttributes(org.w3c.dom.Node)
for better performances.
public static java.lang.String getAttributeValue(org.w3c.dom.Element element, java.lang.String name)
null
if attribute not found or empty.
public static java.util.List filterNodeList(org.w3c.dom.NodeList nodeList, short keepNodeType)
public static java.util.List<org.w3c.dom.Node> filterNodeList(org.w3c.dom.NodeList nodeList, short keepNodeType, java.lang.String nodeName)
public static java.util.List filterNodeListElements(org.w3c.dom.NodeList nodeList)
public static java.util.List<org.w3c.dom.Node> filterNodeListElements(org.w3c.dom.NodeList nodeList, java.lang.String nodeName)
public static java.util.List getChildElements(org.w3c.dom.Node node)
public static java.util.List getChildElements(org.w3c.dom.Node node, java.lang.String nodeName)
public static java.lang.String getFirstChildTextNodeValue(org.w3c.dom.Node node)
null
if not found.
public static java.lang.String getChildTextNodeValue(org.w3c.dom.Node node)
null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |