org.jaxen.saxpath
Class XPathSyntaxException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.jaxen.saxpath.SAXPathException
              extended byorg.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
private static java.lang.String lineSeparator
           
private  int position
           
private static long serialVersionUID
           
private  java.lang.String xpath
           
 
Fields inherited from class org.jaxen.saxpath.SAXPathException
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
XPathSyntaxException(java.lang.String xpath, int position, java.lang.String message)
          Creates a new XPathSyntaxException.
 
Method Summary
 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
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 expression
position - the index of the character at which the syntax error was detected
message - 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()

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