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


Java Severity.ERROR属性代码示例

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


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

示例1: getSeverity

@NonNull
@Override
public Severity getSeverity(@NonNull Issue issue) {
    Severity severity = computeSeverity(issue);

    if (mFatalOnly && severity != Severity.FATAL) {
        return Severity.IGNORE;
    }

    if (mFlags.isWarningsAsErrors() && severity == Severity.WARNING) {
        severity = Severity.ERROR;
    }

    if (mFlags.isIgnoreWarnings() && severity == Severity.WARNING) {
        severity = Severity.IGNORE;
    }

    return severity;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:LintCliClient.java

示例2: writeOverview

private void writeOverview(List<List<Warning>> related, int missingCount)
        throws IOException {
    // Write issue id summary
    mWriter.write("<table class=\"overview\">\n");                          //$NON-NLS-1$

    String errorUrl = null;
    String warningUrl = null;
    if (!mSimpleFormat) {
        errorUrl = addLocalResources(getErrorIconUrl());
        warningUrl = addLocalResources(getWarningIconUrl());
        mFixUrl = addLocalResources(HtmlReporter.class.getResource("lint-run.png")); //$NON-NLS-1$)
    }

    Category previousCategory = null;
    for (List<Warning> warnings : related) {
        Issue issue = warnings.get(0).issue;

        boolean isError = false;
        for (Warning warning : warnings) {
            if (warning.severity == Severity.ERROR || warning.severity == Severity.FATAL) {
                isError = true;
                break;
            }
        }

        if (issue.getCategory() != previousCategory) {
            mWriter.write("<tr><td></td><td class=\"categoryColumn\">");
            previousCategory = issue.getCategory();
            String categoryName = issue.getCategory().getFullName();
            mWriter.write("<a href=\"#");                        //$NON-NLS-1$
            mWriter.write(categoryName);
            mWriter.write("\">");                                //$NON-NLS-1$
            mWriter.write(categoryName);
            mWriter.write("</a>\n");                             //$NON-NLS-1$
            mWriter.write("</td></tr>");                         //$NON-NLS-1$
            mWriter.write("\n");                                 //$NON-NLS-1$
        }
        mWriter.write("<tr>\n");                                 //$NON-NLS-1$

        // Count column
        mWriter.write("<td class=\"countColumn\">");             //$NON-NLS-1$
        mWriter.write(Integer.toString(warnings.size()));
        mWriter.write("</td>");                                  //$NON-NLS-1$

        mWriter.write("<td class=\"issueColumn\">");             //$NON-NLS-1$

        String imageUrl = isError ? errorUrl : warningUrl;
        if (imageUrl != null) {
            mWriter.write("<img border=\"0\" align=\"top\" src=\""); //$NON-NLS-1$
            mWriter.write(imageUrl);
            mWriter.write("\" alt=\"");
            mWriter.write(isError ? "Error" : "Warning");
            mWriter.write("\" />\n");                            //$NON-NLS-1$
        }

        mWriter.write("<a href=\"#");                            //$NON-NLS-1$
        mWriter.write(issue.getId());
        mWriter.write("\">");                                    //$NON-NLS-1$
        mWriter.write(issue.getId());
        mWriter.write(": ");                                     //$NON-NLS-1$
        mWriter.write(issue.getBriefDescription(HTML));
        mWriter.write("</a>\n");                                 //$NON-NLS-1$

        mWriter.write("</td></tr>\n");
    }

    if (missingCount > 0 && !mClient.isCheckingSpecificIssues()) {
        mWriter.write("<tr><td></td>");                          //$NON-NLS-1$
        mWriter.write("<td class=\"categoryColumn\">");          //$NON-NLS-1$
        mWriter.write("<a href=\"#MissingIssues\">");            //$NON-NLS-1$
        mWriter.write(String.format("Disabled Checks (%1$d)",
                missingCount));

        mWriter.write("</a>\n");                                 //$NON-NLS-1$
        mWriter.write("</td></tr>");                             //$NON-NLS-1$
    }

    mWriter.write("</table>\n");                                 //$NON-NLS-1$
    mWriter.write("<br/>");                                      //$NON-NLS-1$
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:80,代码来源:HtmlReporter.java


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