本文整理汇总了Java中com.android.tools.lint.detector.api.Issue.getDefaultSeverity方法的典型用法代码示例。如果您正苦于以下问题:Java Issue.getDefaultSeverity方法的具体用法?Java Issue.getDefaultSeverity怎么用?Java Issue.getDefaultSeverity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.tools.lint.detector.api.Issue
的用法示例。
在下文中一共展示了Issue.getDefaultSeverity方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDefaultSeverity
import com.android.tools.lint.detector.api.Issue; //导入方法依赖的package包/类
@NonNull
protected Severity getDefaultSeverity(@NonNull Issue issue) {
if (!issue.isEnabledByDefault()) {
return Severity.IGNORE;
}
return issue.getDefaultSeverity();
}
示例2: getDefaultSeverity
import com.android.tools.lint.detector.api.Issue; //导入方法依赖的package包/类
@Override
@NonNull
protected Severity getDefaultSeverity(@NonNull Issue issue) {
// In unit tests, include issues that are ignored by default
Severity severity = super.getDefaultSeverity(issue);
if (severity == Severity.IGNORE) {
if (issue.getDefaultSeverity() != Severity.IGNORE) {
return issue.getDefaultSeverity();
}
return Severity.WARNING;
}
return severity;
}
示例3: getDefaultSeverity
import com.android.tools.lint.detector.api.Issue; //导入方法依赖的package包/类
@NonNull
@Override
protected Severity getDefaultSeverity(@NonNull Issue issue) {
if (mFlags.isCheckAllWarnings()) {
return issue.getDefaultSeverity();
}
return super.getDefaultSeverity(issue);
}
示例4: computeSeverity
import com.android.tools.lint.detector.api.Issue; //导入方法依赖的package包/类
private Severity computeSeverity(@NonNull Issue issue) {
Severity severity = super.getSeverity(issue);
String id = issue.getId();
Set<String> suppress = mFlags.getSuppressedIds();
if (suppress.contains(id)) {
return Severity.IGNORE;
}
Severity manual = mFlags.getSeverityOverrides().get(id);
if (manual != null) {
return manual;
}
Set<String> enabled = mFlags.getEnabledIds();
Set<String> check = mFlags.getExactCheckedIds();
if (enabled.contains(id) || (check != null && check.contains(id))) {
// Overriding default
// Detectors shouldn't be returning ignore as a default severity,
// but in case they do, force it up to warning here to ensure that
// it's run
if (severity == Severity.IGNORE) {
severity = issue.getDefaultSeverity();
if (severity == Severity.IGNORE) {
severity = Severity.WARNING;
}
}
return severity;
}
if (check != null && issue != LINT_ERROR && issue != PARSER_ERROR) {
return Severity.IGNORE;
}
return severity;
}
示例5: getSeverity
import com.android.tools.lint.detector.api.Issue; //导入方法依赖的package包/类
/**
* Returns the severity for a given issue. This is the same as the
* {@link Issue#getDefaultSeverity()} unless the user has selected a custom
* severity (which is tool context dependent).
*
* @param issue the issue to look up the severity from
* @return the severity use for issues for the given detector
*/
public Severity getSeverity(@NonNull Issue issue) {
return issue.getDefaultSeverity();
}