org.jaxen

Class XPathSyntaxException


public class XPathSyntaxException
extends JaxenException

Indicates an error during parsing of an XPath expression.
Authors:
bob mcwhirter
James Strachan

Field Summary

private int
position
The position of the error
private static long
serialVersionUID
private String
xpath
The textual XPath expression

Fields inherited from class org.jaxen.JaxenException

javaVersion, serialVersionUID

Fields inherited from class org.jaxen.saxpath.SAXPathException

cause, causeSet, javaVersion, serialVersionUID

Constructor Summary

XPathSyntaxException(String xpath, int position, String message)
Constructor
XPathSyntaxException(XPathSyntaxException e)
Create a new XPathSyntaxException wrapping an existing org.jaxen.saxpath.XPathSyntaxException.

Method Summary

String
getMultilineMessage()
Retrieve the friendly multi-line error message.
int
getPosition()
Retrieve the position of the error.
String
getPositionMarker()
Retrieve a string useful for denoting where the error occurred.
String
getXPath()
Retrieve the expression containing the error.

Methods inherited from class org.jaxen.saxpath.SAXPathException

getCause, initCause, printStackTrace, printStackTrace

Field Details

position

private int position
The position of the error

serialVersionUID

private static final long serialVersionUID
Field Value:
1980601567207604059L

xpath

private String xpath
The textual XPath expression

Constructor Details

XPathSyntaxException

public XPathSyntaxException(String xpath,
                            int position,
                            String message)
Constructor
Parameters:
xpath - the erroneous XPath expression
position - the position of the error
message - the error message

XPathSyntaxException

public XPathSyntaxException(XPathSyntaxException e)
Create a new XPathSyntaxException wrapping an existing org.jaxen.saxpath.XPathSyntaxException.
Parameters:
e - the exception that caused this exception

Method Details

getMultilineMessage

public String getMultilineMessage()
Retrieve the friendly multi-line error message.

This returns a multi-line string that contains the original erroneous XPath expression with a marker underneath indicating exactly where the error occurred.

Returns:
the multi-line error message

getPosition

public int getPosition()
Retrieve the position of the error.
Returns:
the position of the error

getPositionMarker

public String getPositionMarker()
Returns:
the error position marker

getXPath

public String getXPath()
Retrieve the expression containing the error.
Returns:
the erroneous expression