753 */ |
753 */ |
754 public void write(StringBuilder contentBuilder) { |
754 public void write(StringBuilder contentBuilder) { |
755 if (!isInline() && !endsWithNewLine(contentBuilder)) |
755 if (!isInline() && !endsWithNewLine(contentBuilder)) |
756 contentBuilder.append(DocletConstants.NL); |
756 contentBuilder.append(DocletConstants.NL); |
757 String tagString = htmlTag.toString(); |
757 String tagString = htmlTag.toString(); |
758 contentBuilder.append("<" + tagString); |
758 contentBuilder.append("<"); |
|
759 contentBuilder.append(tagString); |
759 Iterator<HtmlAttr> iterator = attrs.keySet().iterator(); |
760 Iterator<HtmlAttr> iterator = attrs.keySet().iterator(); |
760 HtmlAttr key; |
761 HtmlAttr key; |
761 String value = ""; |
762 String value = ""; |
762 while (iterator.hasNext()) { |
763 while (iterator.hasNext()) { |
763 key = iterator.next(); |
764 key = iterator.next(); |
764 value = attrs.get(key); |
765 value = attrs.get(key); |
765 contentBuilder.append(" " + key.toString()); |
766 contentBuilder.append(" "); |
766 if (!value.isEmpty()) |
767 contentBuilder.append(key.toString()); |
767 contentBuilder.append("=\"" + value + "\""); |
768 if (!value.isEmpty()) { |
|
769 contentBuilder.append("=\""); |
|
770 contentBuilder.append(value); |
|
771 contentBuilder.append("\""); |
|
772 } |
768 } |
773 } |
769 contentBuilder.append(">"); |
774 contentBuilder.append(">"); |
770 for (Content c : content) |
775 for (Content c : content) |
771 c.write(contentBuilder); |
776 c.write(contentBuilder); |
772 if (htmlTag.endTagRequired()) |
777 if (htmlTag.endTagRequired()) { |
773 contentBuilder.append("</" + tagString + ">"); |
778 contentBuilder.append("</"); |
|
779 contentBuilder.append(tagString); |
|
780 contentBuilder.append(">"); |
|
781 } |
774 if (!isInline()) |
782 if (!isInline()) |
775 contentBuilder.append(DocletConstants.NL); |
783 contentBuilder.append(DocletConstants.NL); |
776 } |
784 } |
777 } |
785 } |