public class SqlParseException extends Exception implements CalciteParserException
SqlParser.| Modifier and Type | Field and Description |
|---|---|
private int[][] |
expectedTokenSequences |
private Throwable |
parserException
The original exception thrown by the generated parser.
|
private SqlParserPos |
pos |
private String[] |
tokenImages |
| Constructor and Description |
|---|
SqlParseException(String message,
SqlParserPos pos,
int[][] expectedTokenSequences,
String[] tokenImages,
Throwable parserException)
Creates a SqlParseException.
|
| Modifier and Type | Method and Description |
|---|---|
Throwable |
getCause() |
Collection<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.
|
String[] |
getTokenImages()
Returns the token images.
|
private Object |
writeReplace()
Per
Serializable API, provides a replacement object to be
written during serialization. |
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringprivate final SqlParserPos pos
private final int[][] expectedTokenSequences
private final String[] tokenImages
private final transient Throwable parserException
Also, make it transient, because it is a ParseException generated by JavaCC and contains a non-serializable Token.
public SqlParseException(String message, SqlParserPos pos, int[][] expectedTokenSequences, String[] tokenImages, Throwable parserException)
message - Messagepos - PositionexpectedTokenSequences - Token sequencestokenImages - Token imagesparserException - Parser exceptionpublic SqlParserPos getPos()
public Collection<String> getExpectedTokenNames()
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"
public String[] getTokenImages()
public int[][] getExpectedTokenSequences()
private Object writeReplace()
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.
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.