Package org.jaxen.saxpath
Class XPathSyntaxException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.jaxen.saxpath.SAXPathException
-
- org.jaxen.saxpath.XPathSyntaxException
-
- All Implemented Interfaces:
java.io.Serializable
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.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
lineSeparator
private int
position
private static long
serialVersionUID
private java.lang.String
xpath
-
Constructor Summary
Constructors Constructor Description XPathSyntaxException(java.lang.String xpath, int position, java.lang.String message)
Creates a new XPathSyntaxException.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getMultilineMessage()
Returns a long formatted description of the error, including line breaks.int
getPosition()
Returns the index of the character at which the syntax error was detected in the XPath expression.private java.lang.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.java.lang.String
getXPath()
Returns the syntactically incorrect XPath expression.java.lang.String
toString()
-
Methods inherited from class org.jaxen.saxpath.SAXPathException
getCause, initCause, printStackTrace, printStackTrace
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
xpath
private java.lang.String xpath
-
position
private int position
-
lineSeparator
private static final java.lang.String lineSeparator
-
-
Constructor Detail
-
XPathSyntaxException
public XPathSyntaxException(java.lang.String xpath, int position, java.lang.String message)
Creates a new XPathSyntaxException.- Parameters:
xpath
- the incorrect XPath expressionposition
- the index of the character at which the syntax error was detectedmessage
- the detail message
-
-
Method Detail
-
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
-
getXPath
public java.lang.String getXPath()
Returns the syntactically incorrect XPath expression.
- Returns:
- the syntactically incorrect XPath expression
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Throwable
-
getPositionMarker
private java.lang.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
-
getMultilineMessage
public java.lang.String getMultilineMessage()
Returns a long formatted description of the error, including line breaks.
- Returns:
- a longer description of the error on multiple lines
-
-