protected void renderBody()

in src/main/java/org/apache/maven/report/projectinfo/MailingListsReport.java [112:238]


        protected void renderBody() {
            List<MailingList> mailingLists = model.getMailingLists();

            if (mailingLists == null || mailingLists.isEmpty()) {
                startSection(getTitle());

                paragraph(getI18nString("nolist"));

                endSection();

                return;
            }

            startSection(getTitle());

            paragraph(getI18nString("intro"));

            startTable();

            // To beautify the display with other archives
            boolean otherArchives = false;
            for (MailingList m : mailingLists) {
                if (m.getOtherArchives() != null && !m.getOtherArchives().isEmpty()) {
                    otherArchives = true;
                }
            }

            String name = getI18nString("column.name");
            String subscribe = getI18nString("column.subscribe");
            String unsubscribe = getI18nString("column.unsubscribe");
            String post = getI18nString("column.post");
            String archive = getI18nString("column.archive");
            String archivesOther = getI18nString("column.otherArchives");

            if (otherArchives) {
                tableHeader(new String[] {name, subscribe, unsubscribe, post, archive, archivesOther});
            } else {
                tableHeader(new String[] {name, subscribe, unsubscribe, post, archive});
            }

            for (MailingList mailingList : model.getMailingLists()) {
                List<String> textRow = new ArrayList<>();

                if (StringUtils.isNotEmpty(mailingList.getName())) {
                    textRow.add(mailingList.getName());
                } else {
                    textRow.add("-");
                }

                if (StringUtils.isNotEmpty(mailingList.getSubscribe())) {
                    textRow.add(createURILinkPatternedText(subscribe, mailingList.getSubscribe()));
                } else {
                    textRow.add("-");
                }

                if (StringUtils.isNotEmpty(mailingList.getUnsubscribe())) {
                    textRow.add(createURILinkPatternedText(unsubscribe, mailingList.getUnsubscribe()));
                } else {
                    textRow.add("-");
                }

                if (StringUtils.isNotEmpty(mailingList.getPost())) {
                    textRow.add(createURILinkPatternedText(post, mailingList.getPost()));
                } else {
                    textRow.add("-");
                }

                if (mailingList.getArchive() != null
                        && !mailingList.getArchive().isEmpty()) {
                    textRow.add(createLinkPatternedText(
                            ProjectInfoReportUtils.getArchiveServer(mailingList.getArchive()),
                            mailingList.getArchive()));
                } else {
                    textRow.add("-");
                }

                if (mailingList.getOtherArchives() != null
                        && !mailingList.getOtherArchives().isEmpty()) {
                    // For the first line
                    Iterator<String> it = mailingList.getOtherArchives().iterator();
                    String otherArchive = it.next();

                    textRow.add(createLinkPatternedText(
                            ProjectInfoReportUtils.getArchiveServer(otherArchive), otherArchive));

                    tableRow(textRow.toArray(new String[textRow.size()]));

                    // Other lines...
                    while (it.hasNext()) {
                        otherArchive = it.next();

                        // Reinit the list to beautify the display
                        textRow = new ArrayList<>();

                        // Name
                        textRow.add(" ");

                        // Subscribe
                        textRow.add(" ");

                        // UnSubscribe
                        textRow.add(" ");

                        // Post
                        textRow.add(" ");

                        // Archive
                        textRow.add(" ");

                        textRow.add(createLinkPatternedText(
                                ProjectInfoReportUtils.getArchiveServer(otherArchive), otherArchive));

                        tableRow(textRow.toArray(new String[textRow.size()]));
                    }
                } else {
                    if (otherArchives) {
                        textRow.add(null);
                    }

                    tableRow(textRow.toArray(new String[textRow.size()]));
                }
            }

            endTable();

            endSection();
        }