Clover coverage report - Maven Clover report
Coverage timestamp: Sun Mar 18 2007 17:43:17 CET
file stats: LOC: 76   Methods: 12
NCLOC: 59   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
RDocCommentBuilderImpl.java 66.7% 100% 100% 95.2%
coverage coverage
 1    package com.agical.rdoc.core.model.impl;
 2   
 3    import com.agical.rdoc.core.model.TDDocCommentBuilder;
 4    import com.agical.rdoc.core.model.TextFormatter;
 5   
 6    public class RDocCommentBuilderImpl implements TDDocCommentBuilder {
 7    private final TextFormatter textFormatter;
 8    private boolean inParagraph = false;
 9    private final StringBuffer commentBuffer;
 10   
 11  71 public RDocCommentBuilderImpl(TextFormatter textFormatter) {
 12  71 this(new StringBuffer(), textFormatter);
 13   
 14    }
 15   
 16  71 public RDocCommentBuilderImpl(StringBuffer commentBuffer, TextFormatter textFormatter) {
 17  71 this.commentBuffer = commentBuffer;
 18  71 this.textFormatter = textFormatter;
 19    }
 20   
 21   
 22  2359 public void character(String characterData) {
 23  2359 append(characterData);
 24    }
 25   
 26  3940 private void append(String data) {
 27  3940 if (!inParagraph) {
 28  71 inParagraph = true;
 29  71 append(textFormatter.beginParagraph());
 30    }
 31  3940 commentBuffer.append(data);
 32    }
 33   
 34  71 public void end() {
 35  71 if (inParagraph) {
 36  71 inParagraph = false;
 37  71 commentBuffer.append(textFormatter.endParagraph());
 38    }
 39   
 40    }
 41   
 42  71 public String toString() {
 43  71 return commentBuffer.toString();
 44    }
 45   
 46  5 public void strong(String strongText) {
 47  5 append(textFormatter.beginStrong());
 48  5 append(strongText);
 49  5 append(textFormatter.endStrong());
 50    }
 51   
 52  5 public void emphasized(String text) {
 53  5 append(textFormatter.beginEmphasis());
 54  5 append(text);
 55  5 append(textFormatter.endEmphasis());
 56    }
 57   
 58  1 public void newParagraph() {
 59  1 if (inParagraph) {
 60  1 append(textFormatter.endParagraph());
 61  1 append(textFormatter.beginParagraph());
 62    }
 63    }
 64   
 65  88 public void newLine() {
 66  88 append("\n");
 67    }
 68   
 69  1369 public void space() {
 70  1369 append(" ");
 71    }
 72   
 73  21 public void tab() {
 74  21 append("\t");
 75    }
 76    }