本文整理汇总了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;
}
示例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$
}