Package org.jdom2.xpath.util
Class XPathDiagnosticImpl<T>
java.lang.Object
org.jdom2.xpath.util.XPathDiagnosticImpl<T>
- Type Parameters:
T
- The generic type of the results from theXPathExpression
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionXPathDiagnosticImpl
(Object dcontext, XPathExpression<T> dxpath, List<?> inraw, boolean dfirstonly) Create a useful Diagnostic instance for tracing XPath query results. -
Method Summary
Modifier and TypeMethodDescriptionReturns the XPath results which are not returned by the regular evaluate process.Returns the XPath results before any were filtered.Returns the results as they would be returned by the regular evaluate process (read-only).boolean
Indicate whether the query was evaluated as a first-only evaluation.toString()
-
Constructor Details
-
XPathDiagnosticImpl
public XPathDiagnosticImpl(Object dcontext, XPathExpression<T> dxpath, 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
- TheXPathExpression
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 Details
-
getContext
- Specified by:
getContext
in interfaceXPathDiagnostic<T>
- Returns:
- The context object against which the XPath query was evaluated.
-
getXPathExpression
- Specified by:
getXPathExpression
in interfaceXPathDiagnostic<T>
- Returns:
- the
XPathExpression
instance that generated this diagnostic.
-
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 interfaceXPathDiagnostic<T>
- Returns:
- the regular evaluated results.
-
getFilteredResults
Description copied from interface:XPathDiagnostic
Returns the XPath results which are not returned by the regular evaluate process.- Specified by:
getFilteredResults
in interfaceXPathDiagnostic<T>
- Returns:
- those results which were returned by the XPath query but were filtered out by the JDOM Filter.
-
getRawResults
Description copied from interface:XPathDiagnostic
Returns the XPath results before any were filtered.- Specified by:
getRawResults
in interfaceXPathDiagnostic<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 interfaceXPathDiagnostic<T>
- Returns:
- true if the evaluation was a first-only evaluation.
-
toString
-