Package org.jaxen
Class XPathSyntaxException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.jaxen.saxpath.SAXPathException
-
- org.jaxen.JaxenException
-
- org.jaxen.XPathSyntaxException
-
- All Implemented Interfaces:
java.io.Serializable
public class XPathSyntaxException extends JaxenException
Indicates an error during parsing of an XPath expression.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private int
position
The position of the errorprivate static long
serialVersionUID
private java.lang.String
xpath
The textual XPath expression-
Fields inherited from class org.jaxen.JaxenException
javaVersion
-
-
Constructor Summary
Constructors Constructor Description XPathSyntaxException(java.lang.String xpath, int position, java.lang.String message)
ConstructorXPathSyntaxException(XPathSyntaxException e)
Create a new XPathSyntaxException wrapping an existingorg.jaxen.saxpath.XPathSyntaxException
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getMultilineMessage()
Retrieve the friendly multi-line error message.int
getPosition()
Retrieve the position of the error.java.lang.String
getPositionMarker()
Retrieve a string useful for denoting where the error occurred.java.lang.String
getXPath()
Retrieve the expression containing the error.-
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
The textual XPath expression
-
position
private int position
The position of the error
-
-
Constructor Detail
-
XPathSyntaxException
public XPathSyntaxException(XPathSyntaxException e)
Create a new XPathSyntaxException wrapping an existingorg.jaxen.saxpath.XPathSyntaxException
.- Parameters:
e
- the exception that caused this exception
-
XPathSyntaxException
public XPathSyntaxException(java.lang.String xpath, int position, java.lang.String message)
Constructor- Parameters:
xpath
- the erroneous XPath expressionposition
- the position of the errormessage
- the error message
-
-
Method Detail
-
getPosition
public int getPosition()
Retrieve the position of the error.- Returns:
- the position of the error
-
getXPath
public java.lang.String getXPath()
Retrieve the expression containing the error.- Returns:
- the erroneous expression
-
getPositionMarker
public java.lang.String getPositionMarker()
Retrieve a string useful for denoting where the error occurred.This is a string composed of whitespace and a marker at the position (see
getPosition()
) of the error. This is useful for creating friendly multi-line error displays.- Returns:
- the error position marker
-
getMultilineMessage
public java.lang.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
-
-