|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objectorg.thymeleaf.dom.DOMSelector
public final class DOMSelector
DOM Selectors model selections of subtrees from Thymeleaf DOM trees.
A common use of these selectors is for including fragments of other templates without the need of these other templates having any Thymeleaf code.
DOM Selector syntax is a subset of XPath, including:
For example: //div[@id="menu"].
Objects of this class are thread-safe.
Nested Class Summary | |
---|---|
static interface |
DOMSelector.INodeReferenceChecker
|
Constructor Summary | |
---|---|
DOMSelector(String selectorExpression)
Creates a new DOM selector specified by the argument selector expression. |
Method Summary | |
---|---|
String |
getSelectorExpression()
Returns the expression that specifies this DOM selector. |
List<Node> |
select(List<Node> nodes)
Executes the DOM selector against the specified list of nodes, returning the result of applying the selector expression. |
List<Node> |
select(List<Node> nodes,
DOMSelector.INodeReferenceChecker referenceChecker)
Executes the DOM selector against the specified list of nodes and using the specified reference checker (if references are used in the DOM selector expression). |
List<Node> |
select(Node node)
Executes the DOM selector against the specified node, returning the result of applying the selector expression. |
List<Node> |
select(Node node,
DOMSelector.INodeReferenceChecker referenceChecker)
Executes the DOM selector against the specified node and using the specified reference checker (if references are used in the DOM selector expression). |
String |
toString()
|
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DOMSelector(String selectorExpression)
Creates a new DOM selector specified by the argument selector expression.
selectorExpression
- the expression specifying the selector to be used.Method Detail |
---|
public String getSelectorExpression()
Returns the expression that specifies this DOM selector.
public List<Node> select(Node node)
Executes the DOM selector against the specified node, returning the result of applying the selector expression.
node
- the node on which the selector will be executed.
public List<Node> select(Node node, DOMSelector.INodeReferenceChecker referenceChecker)
Executes the DOM selector against the specified node and using the specified reference checker (if references are used in the DOM selector expression).
node
- the node on which the selector will be executed.referenceChecker
- the checker that will be used to compute whether a Node matches or not
a specified reference. Can be null.
public List<Node> select(List<Node> nodes)
Executes the DOM selector against the specified list of nodes, returning the result of applying the selector expression.
nodes
- the nodes on which the selector will be executed.
public List<Node> select(List<Node> nodes, DOMSelector.INodeReferenceChecker referenceChecker)
Executes the DOM selector against the specified list of nodes and using the specified reference checker (if references are used in the DOM selector expression).
nodes
- the nodes on which the selector will be executed.referenceChecker
- the checker that will be used to compute whether a Node matches or not
a specified reference. Can be null.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |