Class XPathQueryExecutor

java.lang.Object
scriptella.driver.xpath.XPathQueryExecutor
All Implemented Interfaces:
ParametersCallback

public class XPathQueryExecutor extends Object implements ParametersCallback
Executor for XPath queries.
Version:
1.0
Author:
Fyodor Kupolov, Martin Alderson
  • 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 compiler
      counter - statement counter.
      returnArrays - true if string arrays should be returned for variables.
  • Method Details

    • execute

      public void execute(QueryCallback queryCallback, ParametersCallback parentParameters)
      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

      public Object getParameter(String name)
      Description copied from interface: ParametersCallback
      Returns the value of parameter specified by name.

      The callback internally delegates a call to parent callbacks if the parameter cannot be found.

      Specified by:
      getParameter in interface ParametersCallback
      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.