Package scriptella.driver.xpath
Class XPathQueryExecutor
java.lang.Object
scriptella.driver.xpath.XPathQueryExecutor
- All Implemented Interfaces:
ParametersCallback
Executor for XPath queries.
- Version:
- 1.0
- Author:
- Fyodor Kupolov, Martin Alderson
-
Constructor Summary
ConstructorsConstructorDescriptionXPathQueryExecutor(ThreadLocal<Node> context, Document document, Resource xpathResource, scriptella.driver.xpath.XPathExpressionCompiler compiler, AbstractConnection.StatementCounter counter, boolean returnArrays) Crates executor to query document using a specified xpath expression. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(QueryCallback queryCallback, ParametersCallback parentParameters) Executes a query and notifies queryCallback for each found node.getParameter(String name) Returns the value of parameter specified by name.
-
Constructor Details
-
XPathQueryExecutor
public XPathQueryExecutor(ThreadLocal<Node> context, Document document, Resource xpathResource, scriptella.driver.xpath.XPathExpressionCompiler compiler, AbstractConnection.StatementCounter counter, boolean returnArrays) Crates executor to query document using a specified xpath expression.- Parameters:
context- thread local for sharing current node between queries. The instance of thread local is shared between all connection queries.document- document to query.xpathResource- resource with xpath expression.compiler- xpath expression compilercounter- statement counter.returnArrays- true if string arrays should be returned for variables.
-
-
Method Details
-
execute
Executes a query and notifies queryCallback for each found node.- Parameters:
queryCallback- callback to notify for each found node.parentParameters- parent parameters to inherit.
-
getParameter
Description copied from interface:ParametersCallbackReturns the value of parameter specified by name.The callback internally delegates a call to parent callbacks if the parameter cannot be found.
- Specified by:
getParameterin interfaceParametersCallback- Parameters:
name- parameter name. Providers are allowed (but not required) to ignore a case of the name parameter to comply with their internal model. For example JDBC drivers are case-insensitive to column names.- Returns:
- parameter value or null if parameter doesn't exist.
-