Class 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
    • 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 java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, printStackTrace, setStackTrace
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • 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()
        Overrides:
        toString in class java.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