|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apgrid.grpc.util.XMLUtil
Provides utility functions for parsing XML.
Constructor Summary | |
XMLUtil()
|
Method Summary | |
static int |
countChildNode(org.w3c.dom.Node node,
java.lang.String name)
Counts the number of a child node. |
static java.lang.String |
getAttributeValue(org.w3c.dom.Node node,
java.lang.String name)
Gets attribute variables of the specified node. |
static org.w3c.dom.Node |
getCdataNode(org.w3c.dom.Node node)
Gets a CDATA node from the specified node. |
static org.w3c.dom.Node |
getChildNode(org.w3c.dom.Node node,
java.lang.String name)
Gets specified child node from the specified node. If there are several nodes which have same name, the node which was appeared at 1st will be returned. |
static org.w3c.dom.Node |
getChildNode(org.w3c.dom.Node node,
java.lang.String name,
int occur)
Gets specified child node from the specified node. If there are several nodes which have same name, the node which was appeared in specified index will be returned. |
static org.w3c.dom.Node |
getChildNodeGentle(org.w3c.dom.Node node,
java.lang.String name)
Gets specified child node from the specified node. If there are several nodes which have same name, the node which was appeared at 1st will be returned. This methods will not throw any Exception. |
static org.w3c.dom.Node |
getNode(java.lang.String str)
Gets XML node from specified string. |
static java.lang.String |
getNodeValue(org.w3c.dom.Node node)
Gets variable of the specified node. |
static void |
printNode(org.w3c.dom.Node node,
int level)
Prints information of the specified node. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLUtil()
Method Detail |
public static org.w3c.dom.Node getCdataNode(org.w3c.dom.Node node) throws NgXMLReadException
node
- the specified node.
NgXMLReadException
- if can't find CDATA node.public static org.w3c.dom.Node getChildNodeGentle(org.w3c.dom.Node node, java.lang.String name)
node
- the specified node.name
- a name of the child node.
public static org.w3c.dom.Node getChildNode(org.w3c.dom.Node node, java.lang.String name) throws NgXMLReadException
node
- the specified node.name
- a name of the child node.
NgXMLReadException
- if there are no specified node.public static org.w3c.dom.Node getChildNode(org.w3c.dom.Node node, java.lang.String name, int occur) throws NgXMLReadException
node
- the specified node.name
- a name of the child node.occur
- specified index.
NgXMLReadException
- if there are no specified node.public static int countChildNode(org.w3c.dom.Node node, java.lang.String name) throws NgXMLReadException
node
- the specified node.name
- a name of the child node.
NgXMLReadException
- if there are no specified node.public static java.lang.String getAttributeValue(org.w3c.dom.Node node, java.lang.String name) throws NgXMLReadException
node
- the specified node.name
- a name of the child node.
NgXMLReadException
- if there are no attribute variable.public static org.w3c.dom.Node getNode(java.lang.String str) throws NgXMLReadException
str
- XML string.
NgXMLReadException
- if there are any error when it's parsing XML string.public static java.lang.String getNodeValue(org.w3c.dom.Node node)
node
- the specified node.
public static void printNode(org.w3c.dom.Node node, int level)
node
- the specified node.level
- a number of indent.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |