OsiamAntlrErrorListener.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:resource-server 作者:
/**
 * {@inheritDoc}
 * <p/>
 * The method is overridden to throw an exception if the parsed input has an invalid syntax.
 */
@Override
public void syntaxError(Recognizer<?, ?> recognizer, @Nullable Object offendingSymbol, int line,
        int charPositionInLine, String msg, @Nullable RecognitionException e) {

    String errorMessage = msg;
    if (e instanceof InputMismatchException && msg.endsWith(" expecting VALUE")) {
        errorMessage += ". Please make sure that all values are surrounded by double quotes.";
    }

    throw new IllegalArgumentException(errorMessage);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号