Class SqlParseException

    • Constructor Summary

      Constructors 
      Constructor Description
      SqlParseException​(java.lang.String message, SqlParserPos pos, int[][] expectedTokenSequences, java.lang.String[] tokenImages, java.lang.Throwable parserException)
      Creates a SqlParseException.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Throwable getCause()  
      java.util.Collection<java.lang.String> getExpectedTokenNames()
      Returns a list of the token names which could have legally occurred at this point.
      int[][] getExpectedTokenSequences()
      Returns the expected token sequences.
      SqlParserPos getPos()
      Returns the position where this error occurred.
      java.lang.String[] getTokenImages()
      Returns the token images.
      private java.lang.Object writeReplace()
      Per Serializable API, provides a replacement object to be written during serialization.
      • Methods inherited from class java.lang.Throwable

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

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

      • expectedTokenSequences

        private final int[][] expectedTokenSequences
      • tokenImages

        private final java.lang.String[] tokenImages
      • parserException

        private final transient java.lang.Throwable parserException
        The original exception thrown by the generated parser. Unfortunately, each generated parser throws exceptions of a different class. So, we keep the exception for forensic purposes, but don't print it publicly.

        Also, make it transient, because it is a ParseException generated by JavaCC and contains a non-serializable Token.

    • Constructor Detail

      • SqlParseException

        public SqlParseException​(java.lang.String message,
                                 SqlParserPos pos,
                                 int[][] expectedTokenSequences,
                                 java.lang.String[] tokenImages,
                                 java.lang.Throwable parserException)
        Creates a SqlParseException.
        Parameters:
        message - Message
        pos - Position
        expectedTokenSequences - Token sequences
        tokenImages - Token images
        parserException - Parser exception
    • Method Detail

      • getPos

        public SqlParserPos getPos()
        Returns the position where this error occurred.
        Returns:
        parser position
      • getExpectedTokenNames

        public java.util.Collection<java.lang.String> getExpectedTokenNames()
        Returns a list of the token names which could have legally occurred at this point.

        If some of the alternatives contain multiple tokens, returns the last token of only these longest sequences. (This occurs when the parser is maintaining more than the usual lookup.) For instance, if the possible tokens are

         {"IN"}
         {"BETWEEN"}
         {"LIKE"}
         {"=", "<IDENTIFIER>"}
         {"=", "USER"}
         

        returns

         "<IDENTIFIER>"
         "USER"
         
        Returns:
        list of token names which could have occurred at this point
      • getTokenImages

        public java.lang.String[] getTokenImages()
        Returns the token images.
        Returns:
        token images
      • getExpectedTokenSequences

        public int[][] getExpectedTokenSequences()
        Returns the expected token sequences.
        Returns:
        expected token sequences
      • getCause

        public java.lang.Throwable getCause()
        Overrides:
        getCause in class java.lang.Throwable
      • writeReplace

        private java.lang.Object writeReplace()
        Per Serializable API, provides a replacement object to be written during serialization.

        SqlParseException is serializable but is not available on the client. This implementation converts this SqlParseException into a vanilla RuntimeException with the same message.