private void doRuleRow(ConfReference ref, CheckstyleResults results, String previousCategory) {
        Configuration checkerConfig = ref.configuration;
        ChainedItem<Configuration> parentConfiguration = ref.parentConfiguration;
        String ruleName = checkerConfig.getName();

        sink.tableRow();

        // column 1: rule category
        sink.tableCell();
        String category = ref.category;
        if (!category.equals(previousCategory)) {
            sink.text(category);
        }
        sink.tableCell_();

        // column 2: Rule name + configured attributes
        sink.tableCell();
        if (!"extension".equals(category)) {
            sink.link("http://checkstyle.sourceforge.net/config_" + category + ".html#" + ruleName);
            sink.text(ruleName);
            sink.link_();
        } else {
            sink.text(ruleName);
        }

        List<String> attribnames = new ArrayList<>(Arrays.asList(checkerConfig.getAttributeNames()));
        attribnames.remove("severity"); // special value (deserves unique column)
        if (!attribnames.isEmpty()) {
            sink.list();
            for (String name : attribnames) {
                sink.listItem();

                sink.text(name);

                String value = getConfigAttribute(checkerConfig, null, name, "");
                // special case, Header.header and RegexpHeader.header
                if ("header".equals(name) && ("Header".equals(ruleName) || "RegexpHeader".equals(ruleName))) {
                    String[] lines = StringUtils.split(value, "\\n");
                    int linenum = 1;
                    for (String line : lines) {
                        sink.lineBreak();
                        sink.rawText("<span style=\"color: gray\">");
                        sink.text(linenum + ":");
                        sink.rawText("</span>");
                        sink.nonBreakingSpace();
                        sink.monospaced();
                        sink.text(line);
                        sink.monospaced_();
                        linenum++;
                    }
                } else if ("headerFile".equals(name) && "RegexpHeader".equals(ruleName)) {
                    sink.text(": ");
                    sink.monospaced();
                    sink.text("\"");
                    if (basedir != null) {
                        // Make the headerFile value relative to ${basedir}
                        String path = siteTool.getRelativePath(value, basedir.getAbsolutePath());
                        sink.text(path.replace('\\', '/'));
                    } else {
                        sink.text(value);
                    }
                    sink.text("\"");
                    sink.monospaced_();
                } else {
                    sink.text(": ");
                    sink.monospaced();
                    sink.text("\"");
                    sink.text(value);
                    sink.text("\"");
                    sink.monospaced_();
                }
                sink.listItem_();
            }
            sink.list_();
        }

        sink.tableCell_();

        // column 3: rule violation count
        sink.tableCell();
        sink.text(String.valueOf(ref.violations));
        sink.tableCell_();

        // column 4: severity
        sink.tableCell();
        // Grab the severity from the rule configuration, this time use error as default value
        // Also pass along all parent configurations, so that we can try to find the severity there
        String severity = getConfigAttribute(checkerConfig, parentConfiguration, "severity", "error");
        iconTool.iconSeverity(severity, IconTool.TEXT_SIMPLE);
        sink.tableCell_();

        sink.tableRow_();
    }
private void doRuleRow ( ConfReference ref , CheckstyleResults results , String previousCategory ) { Configuration checkerConfig = ref . configuration ; ChainedItem < Configuration > parentConfiguration = ref . parentConfiguration ; String ruleName = checkerConfig . getName ( ) ; sink . tableRow ( ) ; sink . tableCell ( ) ; String category = ref . category ; if ( ! category . equals ( previousCategory ) ) { sink . text ( category ) ; } sink . tableCell_ ( ) ; sink . tableCell ( ) ; if ( ! "extension" . equals ( category ) ) { sink . link ( "http://checkstyle.sourceforge.net/config_" + category + ".html#" + ruleName ) ; sink . text ( ruleName ) ; sink . link_ ( ) ; } else { sink . text ( ruleName ) ; } List < String > attribnames = new ArrayList < > ( Arrays . asList ( checkerConfig . getAttributeNames ( ) ) ) ; attribnames . remove ( "severity" ) ; if ( ! attribnames . isEmpty ( ) ) { sink . list ( ) ; for ( String name : attribnames ) { sink . listItem ( ) ; sink . text ( name ) ; String value = getConfigAttribute ( checkerConfig , null , name , "" ) ; if ( "header" . equals ( name ) && ( "Header" . equals ( ruleName ) || "RegexpHeader" . equals ( ruleName ) ) ) { String [ ] lines = StringUtils . split ( value , "\\n" ) ; int linenum = 1 ; for ( String line : lines ) { sink . lineBreak ( ) ; sink . rawText ( "<span style=\"color: gray\">" ) ; sink . text ( linenum + ":" ) ; sink . rawText ( "</span>" ) ; sink . nonBreakingSpace ( ) ; sink . monospaced ( ) ; sink . text ( line ) ; sink . monospaced_ ( ) ; linenum ++ ; } } else if ( "headerFile" . equals ( name ) && "RegexpHeader" . equals ( ruleName ) ) { sink . text ( ": " ) ; sink . monospaced ( ) ; sink . text ( "\"" ) ; if ( basedir != null ) { String path = siteTool . getRelativePath ( value , basedir . getAbsolutePath ( ) ) ; sink . text ( path . replace ( '\\' , '/' ) ) ; } else { sink . text ( value ) ; } sink . text ( "\"" ) ; sink . monospaced_ ( ) ; } else { sink . text ( ": " ) ; sink . monospaced ( ) ; sink . text ( "\"" ) ; sink . text ( value ) ; sink . text ( "\"" ) ; sink . monospaced_ ( ) ; } sink . listItem_ ( ) ; } sink . list_ ( ) ; } sink . tableCell_ ( ) ; sink . tableCell ( ) ; sink . text ( String . valueOf ( ref . violations ) ) ; sink . tableCell_ ( ) ; sink . tableCell ( ) ; String severity = getConfigAttribute ( checkerConfig , parentConfiguration , "severity" , "error" ) ; iconTool . iconSeverity ( severity , IconTool . TEXT_SIMPLE ) ; sink . tableCell_ ( ) ; sink . tableRow_ ( ) ; }
Create a summary for one Checkstyle rule.

@param ref              The configuration reference for the row
@param results          The results to summarize
@param previousCategory The previous row's category