Package org.apache.calcite.runtime
Class CalciteContextException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.calcite.runtime.CalciteException
org.apache.calcite.runtime.CalciteContextException
- All Implemented Interfaces:
Serializable
Exception which contains information about the textual context of the causing
exception.
- See Also:
-
Constructor Summary
ConstructorDescriptionCalciteContextException
(String message, Throwable cause) Creates a new CalciteContextException object.CalciteContextException
(String message, Throwable cause, int posLine, int posColumn, int endPosLine, int endPosColumn) Creates a new CalciteContextException object.CalciteContextException
(String message, Throwable cause, String inputText) Creates a new CalciteContextException object. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the 1-based ending column number, or 0 for missing position information.int
Returns the 1-based ending line number, or 0 for missing position information.@Nullable String
@Nullable String
Returns the input string that is associated with the context.int
Returns the 1-based column number, or 0 for missing position information.int
Returns the 1-based line number, or 0 for missing position information.void
setOriginalStatement
(@Nullable String originalStatement) Sets the input string to associate with the current context.void
setPosition
(int posLine, int posColumn) Sets a textual position at which this exception was detected.void
setPosition
(int posLine, int posColumn, int endPosLine, int endPosColumn) Sets a textual range at which this exception was detected.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CalciteContextException
Creates a new CalciteContextException object. This constructor is for use by the generated factory.- Parameters:
message
- error messagecause
- underlying cause, must not be null
-
CalciteContextException
public CalciteContextException(String message, Throwable cause, int posLine, int posColumn, int endPosLine, int endPosColumn) Creates a new CalciteContextException object.- Parameters:
message
- error messagecause
- underlying cause, must not be nullposLine
- 1-based start line numberposColumn
- 1-based start column numberendPosLine
- 1-based end line numberendPosColumn
- 1-based end column number
-
CalciteContextException
Creates a new CalciteContextException object. This constructor is for use by the generated factory.- Parameters:
message
- error messagecause
- underlying cause, must not be nullinputText
- is the orginal SQL statement, may be null
-
-
Method Details
-
setPosition
public void setPosition(int posLine, int posColumn) Sets a textual position at which this exception was detected.- Parameters:
posLine
- 1-based line numberposColumn
- 1-based column number
-
setPosition
public void setPosition(@UnknownInitialization CalciteContextException this, int posLine, int posColumn, int endPosLine, int endPosColumn) Sets a textual range at which this exception was detected.- Parameters:
posLine
- 1-based start line numberposColumn
- 1-based start column numberendPosLine
- 1-based end line numberendPosColumn
- 1-based end column number
-
getPosLine
public int getPosLine()Returns the 1-based line number, or 0 for missing position information. -
getPosColumn
public int getPosColumn()Returns the 1-based column number, or 0 for missing position information. -
getEndPosLine
public int getEndPosLine()Returns the 1-based ending line number, or 0 for missing position information. -
getEndPosColumn
public int getEndPosColumn()Returns the 1-based ending column number, or 0 for missing position information. -
getOriginalStatement
Returns the input string that is associated with the context. -
setOriginalStatement
Sets the input string to associate with the current context. -
getMessage
- Overrides:
getMessage
in classThrowable
-