Package com.android.tools.lint.detector.api

Examples of com.android.tools.lint.detector.api.Severity


    @Override
    public void report(Context context, Issue issue, Location location, String message,
            Object data) {
        assert context.configuration.isEnabled(issue);

        Severity severity = context.configuration.getSeverity(issue);
        if (severity == Severity.IGNORE) {
            return;
        }
        if (severity == Severity.ERROR){
            mFatal = true;
View Full Code Here


                    if (startLength < output.length()) {
                        output.append(' ');
                    }
                }

                Severity severity = warning.severity;
                if (severity == Severity.FATAL) {
                    // Treat the fatal error as an error such that we don't display
                    // both "Fatal:" and "Error:" etc in the error output.
                    severity = Severity.ERROR;
                }
                output.append(severity.getDescription());
                output.append(':');
                output.append(' ');

                output.append(warning.message);
                if (warning.issue != null) {
View Full Code Here

            super(Main.this, null /*project*/, null /*parent*/, lintFile);
        }

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

            if (mAllErrors && severity != Severity.IGNORE) {
                severity = Severity.ERROR;
            }

View Full Code Here

            return super.getDefaultSeverity(issue);
        }

        private Severity computeSeverity(Issue issue) {
            Severity severity = super.getSeverity(issue);

            String id = issue.getId();
            if (mSuppress.contains(id)) {
                return Severity.IGNORE;
            }
View Full Code Here

        }

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

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

            if (mFlags.isWarningsAsErrors() && severity.compareTo(Severity.ERROR) > 0) {
                severity = Severity.ERROR;
            }

            if (mFlags.isIgnoreWarnings() && severity == Severity.WARNING) {
                severity = Severity.IGNORE;
View Full Code Here

            return super.getDefaultSeverity(issue);
        }

        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();
View Full Code Here

        }

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

            if (mFlags.isWarningsAsErrors() && severity != Severity.IGNORE) {
                severity = Severity.ERROR;
            }
View Full Code Here

            return super.getDefaultSeverity(issue);
        }

        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;
View Full Code Here

                    if (startLength < output.length()) {
                        output.append(' ');
                    }
                }

                Severity severity = warning.severity;
                if (severity == Severity.FATAL) {
                    // Treat the fatal error as an error such that we don't display
                    // both "Fatal:" and "Error:" etc in the error output.
                    severity = Severity.ERROR;
                }
                output.append(severity.getDescription());
                output.append(':');
                output.append(' ');

                output.append(warning.message);
                if (warning.issue != null) {
View Full Code Here

        }

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

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

            if (mFlags.isWarningsAsErrors() && severity.compareTo(Severity.ERROR) < 0) {
                severity = Severity.ERROR;
            }

            if (mFlags.isIgnoreWarnings() && severity == Severity.WARNING) {
                severity = Severity.IGNORE;
View Full Code Here

TOP

Related Classes of com.android.tools.lint.detector.api.Severity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.