public class NodeUtils extends Object
| Constructor and Description |
|---|
NodeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
asText(NodeList rootNodes)
Converts the DOM trees rooted at the specified nodes to text, ignoring
any HTML tags.
|
static int |
getAttributeValue(Node node,
String attributeName,
int defaultValue)
get the attribute with the given name from the given node as an int value
|
static String |
getNodeAttribute(Node node,
String attributeName)
get the attribute with the given name from the given node
|
static String |
getNodeAttribute(Node node,
String attributeName,
String defaultValue)
get the attribute with the given name from the given node
|
static boolean |
isNodeAttributePresent(Node node,
String attributeName)
check whether the given Attribute in the Node is Present
|
public static int getAttributeValue(Node node, String attributeName, int defaultValue)
node - - the node to look inattributeName - - the attribute's name to look fordefaultValue - public static String getNodeAttribute(Node node, String attributeName)
node - - the node to look inattributeName - - the attribute's name to look forpublic static String getNodeAttribute(Node node, String attributeName, String defaultValue)
node - - the node to look inattributeName - - the attribute's name to look fordefaultValue - public static boolean isNodeAttributePresent(Node node, String attributeName)
node - - the node to checkattributeName - - the attribute name to checkCopyright © 2012. All Rights Reserved.