Class XPathDiagnosticImpl<T>

  • Type Parameters:
    T - The generic type of the results from the XPathExpression
    All Implemented Interfaces:
    XPathDiagnostic<T>

    public class XPathDiagnosticImpl<T>
    extends java.lang.Object
    implements XPathDiagnostic<T>
    A diagnostic implementation useful for diagnosing problems in XPath results.

    This class tries to make all the data available as part of the internal structure which may assist people who are stepping-through the code from a debugging environment.

    Author:
    Rolf Lear
    • Constructor Summary

      Constructors 
      Constructor Description
      XPathDiagnosticImpl​(java.lang.Object dcontext, XPathExpression<T> dxpath, java.util.List<?> inraw, boolean dfirstonly)
      Create a useful Diagnostic instance for tracing XPath query results.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getContext()  
      java.util.List<java.lang.Object> getFilteredResults()
      Returns the XPath results which are not returned by the regular evaluate process.
      java.util.List<java.lang.Object> getRawResults()
      Returns the XPath results before any were filtered.
      java.util.List<T> getResult()
      Returns the results as they would be returned by the regular evaluate process (read-only).
      XPathExpression<T> getXPathExpression()  
      boolean isFirstOnly()
      Indicate whether the query was evaluated as a first-only evaluation.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • XPathDiagnosticImpl

        public XPathDiagnosticImpl​(java.lang.Object dcontext,
                                   XPathExpression<T> dxpath,
                                   java.util.List<?> inraw,
                                   boolean dfirstonly)
        Create a useful Diagnostic instance for tracing XPath query results.
        Parameters:
        dcontext - The context against which the XPath query was run.
        dxpath - The XPathExpression instance which created this diagnostic.
        inraw - The data as returned from the XPath library.
        dfirstonly - If the XPath library was allowed to terminate after the first result.
    • Method Detail

      • getContext

        public java.lang.Object getContext()
        Specified by:
        getContext in interface XPathDiagnostic<T>
        Returns:
        The context object against which the XPath query was evaluated.
      • getResult

        public java.util.List<T> getResult()
        Description copied from interface: XPathDiagnostic
        Returns the results as they would be returned by the regular evaluate process (read-only).
        Specified by:
        getResult in interface XPathDiagnostic<T>
        Returns:
        the regular evaluated results.
      • getFilteredResults

        public java.util.List<java.lang.Object> getFilteredResults()
        Description copied from interface: XPathDiagnostic
        Returns the XPath results which are not returned by the regular evaluate process.
        Specified by:
        getFilteredResults in interface XPathDiagnostic<T>
        Returns:
        those results which were returned by the XPath query but were filtered out by the JDOM Filter.
      • getRawResults

        public java.util.List<java.lang.Object> getRawResults()
        Description copied from interface: XPathDiagnostic
        Returns the XPath results before any were filtered.
        Specified by:
        getRawResults in interface XPathDiagnostic<T>
        Returns:
        those results which were returned by the XPath query before any filtering.
      • isFirstOnly

        public boolean isFirstOnly()
        Description copied from interface: XPathDiagnostic
        Indicate whether the query was evaluated as a first-only evaluation. XPath libraries are allowed to stop processing the results after the first result is retrieved if first-only processing is set.
        Specified by:
        isFirstOnly in interface XPathDiagnostic<T>
        Returns:
        true if the evaluation was a first-only evaluation.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object