Java源码示例:org.apache.calcite.runtime.Resources
示例1
public CalciteException newError(
Resources.ExInst<SqlValidatorException> e) {
if (delegate != null) {
return delegate.newError(e);
} else {
return SqlUtil.newContextException(SqlParserPos.ZERO, e);
}
}
示例2
/**
* Wraps an exception with context.
*/
public static CalciteException newContextException(
final SqlParserPos pos,
Resources.ExInst<?> e,
String inputText) {
CalciteContextException ex = newContextException(pos, e);
ex.setOriginalStatement(inputText);
return ex;
}
示例3
/**
* Wraps an exception with context.
*/
public static CalciteContextException newContextException(
final SqlParserPos pos,
Resources.ExInst<?> e) {
int line = pos.getLineNum();
int col = pos.getColumnNum();
int endLine = pos.getEndLineNum();
int endCol = pos.getEndColumnNum();
return newContextException(line, col, endLine, endCol, e);
}
示例4
/**
* Wraps an exception with context.
*/
public static CalciteContextException newContextException(
int line,
int col,
int endLine,
int endCol,
Resources.ExInst<?> e) {
CalciteContextException contextExcn =
(line == endLine && col == endCol
? RESOURCE.validatorContextPoint(line, col)
: RESOURCE.validatorContext(line, col, endLine, endCol)).ex(e.ex());
contextExcn.setPosition(line, col, endLine, endCol);
return contextExcn;
}
示例5
ValidationError(SqlNode sqlNode,
Resources.ExInst<SqlValidatorException> validatorException) {
this.sqlNode = sqlNode;
this.validatorException = validatorException;
}
示例6
@Override public CalciteContextException apply(
SqlNode v0, Resources.ExInst<SqlValidatorException> v1) {
return newValidationError(v0, v1);
}
示例7
public CalciteContextException newValidationError(SqlNode node,
Resources.ExInst<SqlValidatorException> e) {
assert node != null;
final SqlParserPos pos = node.getParserPosition();
return SqlUtil.newContextException(pos, e);
}
示例8
ValidationError(SqlNode sqlNode,
Resources.ExInst<SqlValidatorException> validatorException) {
this.sqlNode = sqlNode;
this.validatorException = validatorException;
}
示例9
@Override public CalciteContextException apply(
SqlNode v0, Resources.ExInst<SqlValidatorException> v1) {
return newValidationError(v0, v1);
}
示例10
public CalciteContextException newValidationError(SqlNode node,
Resources.ExInst<SqlValidatorException> e) {
assert node != null;
final SqlParserPos pos = node.getParserPosition();
return SqlUtil.newContextException(pos, e);
}
示例11
@Resources.BaseMessage("Multiple WATERMARK statements is not supported yet.")
Resources.ExInst<ParseException> multipleWatermarksUnsupported();
示例12
@Resources.BaseMessage("OVERWRITE expression is only used with INSERT statement.")
Resources.ExInst<ParseException> overwriteIsOnlyUsedWithInsert();
示例13
public CalciteException newError(
Resources.ExInst<SqlValidatorException> e) {
return SqlUtil.newContextException(SqlParserPos.ZERO, e);
}
示例14
public CalciteException newError(
Resources.ExInst<SqlValidatorException> e) {
return validator.newValidationError(call, e);
}
示例15
public CalciteException newError(
Resources.ExInst<SqlValidatorException> e) {
return SqlUtil.newContextException(SqlParserPos.ZERO, e);
}
示例16
@Test void testResources() {
Resources.validate(Static.RESOURCE);
checkResourceMethodNames(Static.RESOURCE);
}
示例17
/**
* Wraps a validation error with context appropriate to this operator call.
*
* @param e Validation error, not null
* @return Error wrapped, if possible, with positional information
*/
public abstract CalciteException newError(
Resources.ExInst<SqlValidatorException> e);
示例18
/**
* Adds "line x, column y" context to a validator exception.
*
* <p>Note that the input exception is checked (it derives from
* {@link Exception}) and the output exception is unchecked (it derives from
* {@link RuntimeException}). This is intentional -- it should remind code
* authors to provide context for their validation errors.</p>
*
* @param node The place where the exception occurred, not null
* @param e The validation error
* @return Exception containing positional information, never null
*/
CalciteContextException newValidationError(
SqlNode node,
Resources.ExInst<SqlValidatorException> e);
示例19
/**
* Constructs a new validation error for the call. (Do not use this to
* construct a validation error for other nodes such as an operands.)
*
* @param ex underlying exception
* @return wrapped exception
*/
public CalciteException newValidationError(
Resources.ExInst<SqlValidatorException> ex) {
return validator.newValidationError(call, ex);
}