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

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


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


        if (!issues.isEmpty()) {
            for (Warning warning : issues) {
                mWriter.write('\n');
                indent(mWriter, 1);
                mWriter.write("<issue"); //$NON-NLS-1$
                Issue issue = warning.issue;
                writeAttribute(mWriter, 2, "id", issue.getId());                      //$NON-NLS-1$
                writeAttribute(mWriter, 2, "severity",
                        warning.severity.getDescription());
                writeAttribute(mWriter, 2, "message", warning.message);               //$NON-NLS-1$

                writeAttribute(mWriter, 2, "category",                                //$NON-NLS-1$
                        issue.getCategory().getFullName());
                writeAttribute(mWriter, 2, "priority",                                //$NON-NLS-1$
                        Integer.toString(issue.getPriority()));
                writeAttribute(mWriter, 2, "summary", issue.getDescription(RAW));     //$NON-NLS-1$
                writeAttribute(mWriter, 2, "explanation", issue.getExplanation(RAW)); //$NON-NLS-1$
                List<String> moreInfo = issue.getMoreInfo();
                if (!moreInfo.isEmpty()) {
                    // Compatibility with old format: list first URL
                    writeAttribute(mWriter, 2, "url", moreInfo.get(0));               //$NON-NLS-1$
                    writeAttribute(mWriter, 2, "urls",                                //$NON-NLS-1$
                            Joiner.on(',').join(issue.getMoreInfo()));
                }
                if (warning.errorLine != null && !warning.errorLine.isEmpty()) {
                    String line = warning.errorLine;
                    int index1 = line.indexOf('\n');
                    if (index1 != -1) {
View Full Code Here

                mWriter.write("No issues found.");
                mWriter.write('\n');
                mWriter.flush();
            }
        } else {
            Issue lastIssue = null;
            for (Warning warning : issues) {
                if (warning.issue != lastIssue) {
                    explainIssue(output, lastIssue);
                    lastIssue = warning.issue;
                }
View Full Code Here

        mWriter.write("<br/>\n");                                        //$NON-NLS-1$
        mWriter.write(String.format("%1$d errors and %2$d warnings found:",
                errorCount, warningCount));
        mWriter.write("<br/><br/>\n");                                   //$NON-NLS-1$

        Issue previousIssue = null;
        if (!issues.isEmpty()) {
            List<List<Warning>> related = new ArrayList<List<Warning>>();
            List<Warning> currentList = null;
            for (Warning warning : issues) {
                if (warning.issue != previousIssue) {
                    previousIssue = warning.issue;
                    currentList = new ArrayList<Warning>();
                    related.add(currentList);
                }
                assert currentList != null;
                currentList.add(warning);
            }

            writeOverview(related, missing.size());

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

                if (issue.getCategory() != previousCategory) {
                    previousCategory = issue.getCategory();
                    mWriter.write("\n<a name=\"");                       //$NON-NLS-1$
                    mWriter.write(issue.getCategory().getFullName());
                    mWriter.write("\"></a>\n");                          //$NON-NLS-1$
                    mWriter.write("<div class=\"category\"><a href=\"#\" title=\"Return to top\">");           //$NON-NLS-1$
                    mWriter.write(issue.getCategory().getFullName());
                    mWriter.write("</a><div class=\"categorySeparator\"></div>\n");//$NON-NLS-1$
                    mWriter.write("</div>\n");                           //$NON-NLS-1$
                }

                mWriter.write("<a name=\"" + issue.getId() + "\"></a>\n"); //$NON-NLS-1$ //$NON-NLS-2$
                mWriter.write("<div class=\"issue\">\n");                //$NON-NLS-1$

                // Explain this issue
                mWriter.write("<div class=\"id\"><a href=\"#\" title=\"Return to top\">");                     //$NON-NLS-1$
                mWriter.write(issue.getId());
                mWriter.write(": ");                                     //$NON-NLS-1$
                mWriter.write(issue.getBriefDescription(HTML));
                mWriter.write("</a><div class=\"issueSeparator\"></div>\n"); //$NON-NLS-1$
                mWriter.write("</div>\n");                               //$NON-NLS-1$

                mWriter.write("<div class=\"warningslist\">\n");         //$NON-NLS-1$
                boolean partialHide = !mSimpleFormat && warnings.size() > SPLIT_LIMIT;
View Full Code Here

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

        mWriter.write("<br/>\n");                                        //$NON-NLS-1$
        mWriter.write(String.format("%1$d errors and %2$d warnings found:",
                errorCount, warningCount));
        mWriter.write("<br/><br/>\n");                                   //$NON-NLS-1$

        Issue previousIssue = null;
        if (!issues.isEmpty()) {
            List<List<Warning>> related = new ArrayList<List<Warning>>();
            List<Warning> currentList = null;
            for (Warning warning : issues) {
                if (warning.issue != previousIssue) {
                    previousIssue = warning.issue;
                    currentList = new ArrayList<Warning>();
                    related.add(currentList);
                }
                assert currentList != null;
                currentList.add(warning);
            }

            writeOverview(related, missing.size());

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

                if (issue.getCategory() != previousCategory) {
                    previousCategory = issue.getCategory();
                    mWriter.write("\n<a name=\"");                       //$NON-NLS-1$
                    mWriter.write(issue.getCategory().getFullName());
                    mWriter.write("\"></a>\n");                          //$NON-NLS-1$
                    mWriter.write("<div class=\"category\"><a href=\"#\" title=\"Return to top\">");           //$NON-NLS-1$
                    mWriter.write(issue.getCategory().getFullName());
                    mWriter.write("</a><div class=\"categorySeparator\"></div>\n");//$NON-NLS-1$
                    mWriter.write("</div>\n");                           //$NON-NLS-1$
                }

                mWriter.write("<a name=\"" + issue.getId() + "\"></a>\n"); //$NON-NLS-1$ //$NON-NLS-2$
                mWriter.write("<div class=\"issue\">\n");                //$NON-NLS-1$

                // Explain this issue
                mWriter.write("<div class=\"id\"><a href=\"#\" title=\"Return to top\">");                     //$NON-NLS-1$
                mWriter.write(issue.getId());
                mWriter.write(": ");                                     //$NON-NLS-1$
                mWriter.write(issue.getBriefDescription(HTML));
                mWriter.write("</a><div class=\"issueSeparator\"></div>\n"); //$NON-NLS-1$
                mWriter.write("</div>\n");                               //$NON-NLS-1$

                mWriter.write("<div class=\"warningslist\">\n");         //$NON-NLS-1$
                boolean partialHide = !mSimpleFormat && warnings.size() > SPLIT_LIMIT;
View Full Code Here

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

        if (!issues.isEmpty()) {
            for (Warning warning : issues) {
                mWriter.write('\n');
                indent(mWriter, 1);
                mWriter.write("<issue"); //$NON-NLS-1$
                Issue issue = warning.issue;
                writeAttribute(mWriter, 2, "id", issue.getId());                      //$NON-NLS-1$
                writeAttribute(mWriter, 2, "severity",
                        warning.severity.getDescription());
                writeAttribute(mWriter, 2, "message", warning.message);               //$NON-NLS-1$

                writeAttribute(mWriter, 2, "category",                                //$NON-NLS-1$
                        issue.getCategory().getFullName());
                writeAttribute(mWriter, 2, "priority",                                //$NON-NLS-1$
                        Integer.toString(issue.getPriority()));
                writeAttribute(mWriter, 2, "summary", issue.getDescription(RAW));     //$NON-NLS-1$
                writeAttribute(mWriter, 2, "explanation", issue.getExplanation(RAW)); //$NON-NLS-1$
                List<String> moreInfo = issue.getMoreInfo();
                if (!moreInfo.isEmpty()) {
                    // Compatibility with old format: list first URL
                    writeAttribute(mWriter, 2, "url", moreInfo.get(0));               //$NON-NLS-1$
                    writeAttribute(mWriter, 2, "urls",                                //$NON-NLS-1$
                            Joiner.on(',').join(issue.getMoreInfo()));
                }
                if (warning.errorLine != null && !warning.errorLine.isEmpty()) {
                    String line = warning.errorLine;
                    int index1 = line.indexOf('\n');
                    if (index1 != -1) {
View Full Code Here

TOP

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

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.