Class NodeSelector
java.lang.Object
jodd.lagarto.dom.NodeSelector
Node selector selects DOM nodes using
CSS3 selectors.
Group of queries are supported.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanfilter(List<Node> currentResults, Node node, CssSelector cssSelector, int index) Filter nodes.protected voidprocessSelectors(List<Node> results, List<CssSelector> selectors) Process selectors and keep adding results.Selects nodes using CSS3 selector query.select(Collection<List<CssSelector>> selectorsCollection) Selected nodes using pre-parsed CSS selectors.select(NodeFilter nodeFilter) Selects nodes usingnode filter.select(Node rootNode, List<CssSelector> selectors) protected voidselectAndAdd(Node node, CssSelector cssSelector, List<Node> result) Selects single node for single selector and appends it to the results.selectFirst(String query) Selects nodes using CSS3 selector query and returns the very first one.selectFirst(NodeFilter nodeFilter) Selects nodes usingnode filterand return the very first one.protected voidwalk(Node rootNode, CssSelector cssSelector, List<Node> result) Finds nodes in the tree that matches single selector.protected voidwalk(Node rootNode, NodeFilter nodeFilter, List<Node> result) protected voidwalkDescendantsIteratively(LinkedList<Node> nodes, CssSelector cssSelector, List<Node> result) Walks over the child notes, maintaining the tree order and not using recursion.
-
Field Details
-
rootNode
-
-
Constructor Details
-
NodeSelector
-
-
Method Details
-
select
-
select
Selected nodes using pre-parsed CSS selectors. Take in consideration collection type for results grouping order. -
processSelectors
Process selectors and keep adding results. -
selectFirst
-
select
Selects nodes usingnode filter. -
selectFirst
Selects nodes usingnode filterand return the very first one. -
walk
-
select
-
walkDescendantsIteratively
protected void walkDescendantsIteratively(LinkedList<Node> nodes, CssSelector cssSelector, List<Node> result) Walks over the child notes, maintaining the tree order and not using recursion. -
walk
Finds nodes in the tree that matches single selector. -
selectAndAdd
Selects single node for single selector and appends it to the results. -
filter
Filter nodes.
-