当前位置: 首页>>代码示例>>Java>>正文


Java ECMAErrors.getMessage方法代码示例

本文整理汇总了Java中jdk.nashorn.internal.runtime.ECMAErrors.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ECMAErrors.getMessage方法的具体用法?Java ECMAErrors.getMessage怎么用?Java ECMAErrors.getMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jdk.nashorn.internal.runtime.ECMAErrors的用法示例。


在下文中一共展示了ECMAErrors.getMessage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: throwUnprotectedSwitchError

import jdk.nashorn.internal.runtime.ECMAErrors; //导入方法依赖的package包/类
private void throwUnprotectedSwitchError(final VarNode varNode) {
    // Block scoped declarations in switch statements without explicit blocks should be declared
    // in a common block that contains all the case clauses. We cannot support this without a
    // fundamental rewrite of how switch statements are handled (case nodes contain blocks and are
    // directly contained by switch node). As a temporary solution we throw a reference error here.
    final String msg = ECMAErrors.getMessage("syntax.error.unprotected.switch.declaration", varNode.isLet() ? "let" : "const");
    throwParserException(msg, varNode);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:AssignSymbols.java

示例2: throwNotImplementedYet

import jdk.nashorn.internal.runtime.ECMAErrors; //导入方法依赖的package包/类
private void throwNotImplementedYet(final String msgId, final Node node) {
    final long token = node.getToken();
    final int line = source.getLine(node.getStart());
    final int column = source.getColumn(node.getStart());
    final String message = ECMAErrors.getMessage("unimplemented." + msgId);
    final String formatted = ErrorManager.format(message, source, line, column, token);
    throw new RuntimeException(formatted);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:Lower.java

示例3: syntaxError

import jdk.nashorn.internal.runtime.ECMAErrors; //导入方法依赖的package包/类
private ParserException syntaxError(final int start, final String reason) {
    final String message = ECMAErrors.getMessage("syntax.error.invalid.json", reason);
    return error(message, start);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:JSONParser.java

示例4: message

import jdk.nashorn.internal.runtime.ECMAErrors; //导入方法依赖的package包/类
/**
 * Get the message string for a message ID and arguments
 *
 * @param msgId The Message ID
 * @param args  The arguments
 *
 * @return The message string
 */
protected static String message(final String msgId, final String... args) {
    return ECMAErrors.getMessage("parser.error." + msgId, args);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:AbstractParser.java

示例5: message

import jdk.nashorn.internal.runtime.ECMAErrors; //导入方法依赖的package包/类
/**
 * Get the correctly localized error message for a given message id format arguments
 * @param msgId message id
 * @param args  format arguments
 * @return message
 */
protected static String message(final String msgId, final String... args) {
    return ECMAErrors.getMessage("lexer.error." + msgId, args);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:Lexer.java

示例6: throwParserException

import jdk.nashorn.internal.runtime.ECMAErrors; //导入方法依赖的package包/类
/**
 * Throw a regexp parser exception.
 *
 * @param key the message key
 * @param str string argument
 * @throws jdk.nashorn.internal.runtime.ParserException unconditionally
 */
protected static void throwParserException(final String key, final String str) throws ParserException {
    throw new ParserException(ECMAErrors.getMessage("parser.error.regex." + key, str));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:RegExp.java


注:本文中的jdk.nashorn.internal.runtime.ECMAErrors.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。