Top Description Fields Constructors Methods
org.jdom2.xpath.util

public Class XPathDiagnosticImpl<T>

extends Object
implements XPathDiagnostic<T>
Class Inheritance
All Implemented Interfaces
org.jdom2.xpath.XPathDiagnostic
Type Parameters
<T>
The generic type of the results from the XPathExpression
Imports
java.util.ArrayList, .Collections, .List, org.jdom2.filter.Filter, org.jdom2.xpath.XPathExpression, .XPathDiagnostic

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

Field Summary

Modifier and TypeField and Description
private final Object
private final List<Object>
private final boolean
private final List<Object>
private final List<T>
private final XPathExpression<T>

Constructor Summary

AccessConstructor and Description
public
XPathDiagnosticImpl(Object
The context against which the XPath query was run.
dcontext
,
XPathExpression<T>
The XPathExpression instance which created this diagnostic.
dxpath
,
List<?>
The data as returned from the XPath library.
inraw
,
boolean
If the XPath library was allowed to terminate after the first result.
dfirstonly
)

Create a useful Diagnostic instance for tracing XPath query results.

Method Summary

Modifier and TypeMethod and Description
public Object
public List<Object>
getFilteredResults()

Implements org.jdom2.xpath.XPathDiagnostic.getFilteredResults.

Returns the XPath results which are not returned by the regular evaluate process.
public List<Object>
getRawResults()

Implements org.jdom2.xpath.XPathDiagnostic.getRawResults.

Returns the XPath results before any were filtered.
public List<T>
getResult()

Implements org.jdom2.xpath.XPathDiagnostic.getResult.

Returns the results as they would be returned by the regular evaluate process (read-only).
public XPathExpression<T>
public boolean
isFirstOnly()

Implements org.jdom2.xpath.XPathDiagnostic.isFirstOnly.

Indicate whether the query was evaluated as a first-only evaluation.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

dcontextback to summary
private final Object dcontext
dfilteredback to summary
private final List<Object> dfiltered
dfirstonlyback to summary
private final boolean dfirstonly
drawback to summary
private final List<Object> draw
dresultback to summary
private final List<T> dresult
dxpathback to summary
private final XPathExpression<T> dxpath

Constructor Detail

XPathDiagnosticImplback to summary
public XPathDiagnosticImpl(Object dcontext, XPathExpression<T> dxpath, List<?> inraw, boolean dfirstonly)

Create a useful Diagnostic instance for tracing XPath query results.

Parameters
dcontext:Object

The context against which the XPath query was run.

dxpath:XPathExpression<T>

The XPathExpression instance which created this diagnostic.

inraw:List<?>

The data as returned from the XPath library.

dfirstonly:boolean

If the XPath library was allowed to terminate after the first result.

Method Detail

getContextback to summary
public Object getContext()

Implements org.jdom2.xpath.XPathDiagnostic.getContext.

Returns:Object

Doc from org.jdom2.xpath.XPathDiagnostic.getContext.

The context object against which the XPath query was evaluated.

Annotations
@Override
getFilteredResultsback to summary
public List<Object> getFilteredResults()

Implements org.jdom2.xpath.XPathDiagnostic.getFilteredResults.

Doc from org.jdom2.xpath.XPathDiagnostic.getFilteredResults.

Returns the XPath results which are not returned by the regular evaluate process.

Returns:List<Object>

those results which were returned by the XPath query but were filtered out by the JDOM Filter.

Annotations
@Override
getRawResultsback to summary
public List<Object> getRawResults()

Implements org.jdom2.xpath.XPathDiagnostic.getRawResults.

Doc from org.jdom2.xpath.XPathDiagnostic.getRawResults.

Returns the XPath results before any were filtered.

Returns:List<Object>

those results which were returned by the XPath query before any filtering.

Annotations
@Override
getResultback to summary
public List<T> getResult()

Implements org.jdom2.xpath.XPathDiagnostic.getResult.

Doc from org.jdom2.xpath.XPathDiagnostic.getResult.

Returns the results as they would be returned by the regular evaluate process (read-only).

Returns:List<T>

the regular evaluated results.

Annotations
@Override
getXPathExpressionback to summary
public XPathExpression<T> getXPathExpression()

Implements org.jdom2.xpath.XPathDiagnostic.getXPathExpression.

Returns:XPathExpression<T>

Doc from org.jdom2.xpath.XPathDiagnostic.getXPathExpression.

the XPathExpression instance that generated this diagnostic.

Annotations
@Override
isFirstOnlyback to summary
public boolean isFirstOnly()

Implements org.jdom2.xpath.XPathDiagnostic.isFirstOnly.

Doc from org.jdom2.xpath.XPathDiagnostic.isFirstOnly.

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.

Returns:boolean

true if the evaluation was a first-only evaluation.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override