Interface Queryable

All Known Subinterfaces:
OutputBuilder<X,Y>
All Known Implementing Classes:
BeanBuilder, BeanQueryer, DataFileWriter, JDOMBuilder, JDOMQueryer

public interface Queryable
An interface representing an object that is queryable, particularly using XPath expressions. This need not be a DOM, but could be a bean using JXPath or some such thing.

This interfaces uses the term Node to refer to an object returned by an XPath expression. Value represents the value that a node contains or the value of a node. These need not be different things for instance, on a DOM a Node could be an Element of the DOM tree, its value could be it's CDATA or some other content. On a Bean the node could just be the value returned by the query, and its value would be the same object.

Author:
Jerry Vos
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the root object.
    Extracts a value from a Node and returns it.
    selectNode(Object curContext, String path)
    Selects a node using the specified context as the current location.
    Selects a node from using the current location (or root if no such thing exists) using the specified path.
    List<?>
    selectNodes(Object curContext, String path)
    Selects multiple nodes using the query based at the specified context.
    List<?>
    Selects multiple nodes using the query.
  • Method Details

    • selectNode

      Object selectNode(String path)
      Selects a node from using the current location (or root if no such thing exists) using the specified path. If multiple nodes are returned with the query this will be the first one.
      Parameters:
      path - the XPath query
      Returns:
      the selected node (can be null if the query failed)
    • selectNode

      Object selectNode(Object curContext, String path)
      Selects a node using the specified context as the current location. If multiple nodes are returned with the query this will be the first one.
      Parameters:
      curContext - the context of the query
      path - the query
      Returns:
      the value of the query
      See Also:
    • selectNodes

      List<?> selectNodes(String path)
      Selects multiple nodes using the query.
      Parameters:
      path - the query
      Returns:
      the result
    • selectNodes

      List<?> selectNodes(Object curContext, String path)
      Selects multiple nodes using the query based at the specified context.
      Parameters:
      path - the query
      Returns:
      the result
    • getValue

      Object getValue(Object node)
      Extracts a value from a Node and returns it. What this means is implementation dependent.
      Parameters:
      node - the node to extract a value from
      Returns:
    • getRoot

      Object getRoot()
      Retrieves the root object.
      Returns:
      the root