org.jaxen.saxpath

Class XPathSyntaxException

public class XPathSyntaxException extends SAXPathException

Represents a syntax error in an XPath expression. This is a compile-time error that is detectable irrespective of the context in which the XPath expression is evaluated.
Field Summary
static StringlineSeparator
intposition
static longserialVersionUID
Stringxpath
Constructor Summary
XPathSyntaxException(String xpath, int position, String message)
Creates a new XPathSyntaxException.
Method Summary
StringgetMultilineMessage()

Returns a long formatted description of the error, including line breaks.

intgetPosition()

Returns the index of the character at which the syntax error was detected in the XPath expression.

StringgetPositionMarker()

Returns a string in the form " ^" which, when placed on the line below the XPath expression in a monospaced font, should point to the location of the error.

StringgetXPath()

Returns the syntactically incorrect XPath expression.

StringtoString()

Field Detail

lineSeparator

private static final String lineSeparator

position

private int position

serialVersionUID

private static final long serialVersionUID

xpath

private String xpath

Constructor Detail

XPathSyntaxException

public XPathSyntaxException(String xpath, int position, String message)
Creates a new XPathSyntaxException.

Parameters: xpath the incorrect XPath expression position the index of the character at which the syntax error was detected message the detail message

Method Detail

getMultilineMessage

public String getMultilineMessage()

Returns a long formatted description of the error, including line breaks.

Returns: a longer description of the error on multiple lines

getPosition

public int getPosition()

Returns the index of the character at which the syntax error was detected in the XPath expression.

Returns: the character index in the XPath expression at which the syntax error was detected

getPositionMarker

private String getPositionMarker()

Returns a string in the form " ^" which, when placed on the line below the XPath expression in a monospaced font, should point to the location of the error.

Returns: the position marker

getXPath

public String getXPath()

Returns the syntactically incorrect XPath expression.

Returns: the syntactically incorrect XPath expression

toString

public String toString()