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


Java Log.DeferredDiagnosticHandler方法代码示例

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


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

示例1: Round

import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
/** Create a round (common code). */
private Round(Context context, int number, int priorErrors, int priorWarnings,
        Log.DeferredDiagnosticHandler deferredDiagnosticHandler) {
    this.context = context;
    this.number = number;

    compiler = JavaCompiler.instance(context);
    log = Log.instance(context);
    log.nerrors = priorErrors;
    log.nwarnings = priorWarnings;
    if (number == 1) {
        Assert.checkNonNull(deferredDiagnosticHandler);
        this.deferredDiagnosticHandler = deferredDiagnosticHandler;
    } else {
        this.deferredDiagnosticHandler = new Log.DeferredDiagnosticHandler(log);
    }

    // the following is for the benefit of JavacProcessingEnvironment.getContext()
    JavacProcessingEnvironment.this.context = context;

    // the following will be populated as needed
    topLevelClasses  = List.nil();
    packageInfoFiles = List.nil();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:JavacProcessingEnvironment.java

示例2: Round

import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
/** Create a round (common code). */
private Round(int number, Set<JCCompilationUnit> treesToClean,
        Log.DeferredDiagnosticHandler deferredDiagnosticHandler) {
    this.number = number;

    if (number == 1) {
        Assert.checkNonNull(deferredDiagnosticHandler);
        this.deferredDiagnosticHandler = deferredDiagnosticHandler;
    } else {
        this.deferredDiagnosticHandler = new Log.DeferredDiagnosticHandler(log);
        compiler.setDeferredDiagnosticHandler(this.deferredDiagnosticHandler);
    }

    // the following will be populated as needed
    topLevelClasses  = List.nil();
    packageInfoFiles = List.nil();
    moduleInfoFiles = List.nil();
    this.treesToClean = treesToClean;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:JavacProcessingEnvironment.java

示例3: parse

import com.sun.tools.javac.util.Log; //导入方法依赖的package包/类
/**
 * Parse a reference to an API element as may be found in doc comment.
 * @param sig the signature to be parsed
 * @return a {@code Reference} object containing the result of parsing the signature
 * @throws ParseException if there is an error while parsing the signature
 */
public Reference parse(String sig) throws ParseException {

    // Break sig apart into qualifiedExpr member paramTypes.
    JCTree qualExpr;
    Name member;
    List<JCTree> paramTypes;

    Log.DeferredDiagnosticHandler deferredDiagnosticHandler
            = new Log.DeferredDiagnosticHandler(fac.log);

    try {
        int hash = sig.indexOf("#");
        int lparen = sig.indexOf("(", hash + 1);
        if (hash == -1) {
            if (lparen == -1) {
                qualExpr = parseType(sig);
                member = null;
            } else {
                qualExpr = null;
                member = parseMember(sig.substring(0, lparen));
            }
        } else {
            qualExpr = (hash == 0) ? null : parseType(sig.substring(0, hash));
            if (lparen == -1)
                member = parseMember(sig.substring(hash + 1));
            else
                member = parseMember(sig.substring(hash + 1, lparen));
        }

        if (lparen < 0) {
            paramTypes = null;
        } else {
            int rparen = sig.indexOf(")", lparen);
            if (rparen != sig.length() - 1)
                throw new ParseException("dc.ref.bad.parens");
            paramTypes = parseParams(sig.substring(lparen + 1, rparen));
        }

        if (!deferredDiagnosticHandler.getDiagnostics().isEmpty())
            throw new ParseException("dc.ref.syntax.error");

    } finally {
        fac.log.popDiagnosticHandler(deferredDiagnosticHandler);
    }

    return new Reference(qualExpr, member, paramTypes);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:54,代码来源:ReferenceParser.java


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