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


Java Issue.getDefaultSeverity方法代码示例

本文整理汇总了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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:DefaultConfiguration.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:LintDetectorTest.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:LintCliClient.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:LintCliClient.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:Configuration.java


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