public final class UtilNode extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ATT_CSS
The CSS attribute name.
|
static String |
CSS_LETF
The CSS which set the left argument.
|
static String |
CSS_RIGHT
The CSS which set the right argument.
|
static String |
IGNORE
Any node in specification with attribute "ignore=true" will not be
evaluated.
|
static String |
PENDING
Any node in specification with attribute "pending=true" will be
considered a pending item.
|
| Modifier and Type | Method and Description |
|---|---|
static nu.xom.Node |
appendCss(nu.xom.Node node,
String css)
Add a CSS to the node.
|
static String |
getChildrenAsString(nu.xom.Node parent)
Get child elements as a String.
|
static nu.xom.Node |
getCssNodeOrElement(nu.xom.Node root,
String cssOrElement)
Get the highest node with the style given.
|
static nu.xom.Nodes |
getCssNodesOrElements(nu.xom.Node root,
String cssOrElement)
Get elements of css or tag name.
|
static int |
getDepth(nu.xom.Node node)
Get the node depth in the specification.
|
static nu.xom.Node |
getHighest(nu.xom.Nodes... mnodes)
Get the highest node in the specification hierarchy.
|
static nu.xom.Node |
getLeft(nu.xom.Node root)
Get highest descendant node with class 'CSS_LEFT'.
|
static nu.xom.Node |
getRight(nu.xom.Node root)
Get highest descendant node with class 'CSS_RIGHT'.
|
static boolean |
isElement(nu.xom.Node node,
String tag)
Check if a node is of a given tag type.
|
static boolean |
isIgnore(nu.xom.Node node)
Check is a node is marked to be ignored.
|
static boolean |
isPending(nu.xom.Node node)
Check is a node is marked as pending.
|
static boolean |
matches(nu.xom.Node node,
String xpath)
Check if node matchs the XPath.
|
static void |
removeCss(nu.xom.Node node,
String css)
Remove a CSS from node.
|
static void |
setIgnore(nu.xom.Node node)
Adds the information that a given node might be ignored by runners.
|
public static final String IGNORE
public static final String PENDING
public static final String ATT_CSS
public static final String CSS_LETF
public static final String CSS_RIGHT
public static boolean isIgnore(nu.xom.Node node)
node - The node to be checked.public static boolean isPending(nu.xom.Node node)
node - The node to be checked.public static void setIgnore(nu.xom.Node node)
node - The node to be ignored.public static nu.xom.Node appendCss(nu.xom.Node node,
String css)
node - The node.css - The css to be added (appended).public static void removeCss(nu.xom.Node node,
String css)
node - Node object.css - The node.public static String getChildrenAsString(nu.xom.Node parent)
parent - The parent element.public static nu.xom.Node getHighest(nu.xom.Nodes... mnodes)
mnodes - List of list of nodes.public static int getDepth(nu.xom.Node node)
node - The node.public static boolean matches(nu.xom.Node node,
String xpath)
node - The node.xpath - The xpath.public static nu.xom.Node getLeft(nu.xom.Node root)
throws PluginException
root - The root.PluginException - If node does not exist.public static nu.xom.Node getRight(nu.xom.Node root)
throws PluginException
root - The root.PluginException - If node does not exist.public static nu.xom.Node getCssNodeOrElement(nu.xom.Node root,
String cssOrElement)
throws PluginException
root - The root node.cssOrElement - The expected css.PluginException - If child with css does not exist.public static nu.xom.Nodes getCssNodesOrElements(nu.xom.Node root,
String cssOrElement)
throws PluginException
root - The root node.cssOrElement - The expected css or element.PluginException - If child with css does not exist.public static boolean isElement(nu.xom.Node node,
String tag)
node - The node.tag - The tag.Copyright © 2016. All rights reserved.