org.incava.analysis
public class ContextReport extends Report
Field Summary | |
---|---|
static int | tabWidth
The number of spaces a tab is equivalent to. |
Constructor Summary | |
---|---|
ContextReport(Writer writer)
Creates a context report for the given writer.
| |
ContextReport(OutputStream os)
Creates a context report for the given output stream.
| |
ContextReport(Writer writer, String source)
Creates a context report for the given writer, and a string source.
| |
ContextReport(Writer writer, File file)
Creates a context report for the given writer, and a file source.
| |
ContextReport(OutputStream os, String source)
Creates a context report for the given output stream, and string source.
| |
ContextReport(OutputStream os, File file)
Creates a context report for the given output stream, and file.
|
Method Summary | |
---|---|
protected void | indent(StringBuffer buf, int line, int column, char ch)
Adds indentation to the buffer, replacing spacing and tabs. |
protected void | markToEndOfLine(StringBuffer buf, int line, int column)
Marks the given line with leading spaces to the column position
(inclusive), and from there marking to the end of the line with
"<---...".
|
protected void | markToStartPosition(StringBuffer buf, int line, int column)
Marks the given line with "...--->" leading to the column position
(inclusive).
|
void | reset(File file)
Associates the given file with the list of violations, including that are
adding to this report later, i.e., prior to flush .
|
void | reset(String source)
Associates the given string source with the list of violations, including
that are adding to this report later, i.e., prior to flush .
|
protected String | toString(Violation violation)
Returns a string representing the given violation, consistent with the
format of the Report subclass.
|
protected void | underline(StringBuffer buf, int line, int beginColumn, int endColumn)
Underlines ("<--...-->") from beginColumn to
endColumn in the given line. |
protected void | writeLine(StringBuffer buf, int line)
Writes the given line, adding the line number, right-aligned. |
Parameters: writer The writer associated with this report.
Parameters: os The output stream associated with this report.
Parameters: writer The writer associated with this report. source The source code to which this report applies.
Parameters: writer The writer associated with this report. file The file, containing source code, to which this report applies.
Parameters: os The output stream associated with this report. source The source code to which this report applies.
Parameters: os The output stream associated with this report. file The file, containing source code, to which this report applies.
tabWidth
occurrences of ch
.
Parameters: buf The buffer to be written to. line The current line number. column The column to indent to. ch The character with which to replace spaces and tabs.
Parameters: buf The buffer to be written to. line The current line number. column The column to mark to/from.
Parameters: buf The buffer to be written to. line The current line number. column The column to mark to.
flush
.
Parameters: file The file associated with the set of violations.
flush
.
Parameters: source The source code associated with the set of violations.
Parameters: violation The violation to represent as a string.
beginColumn
to
endColumn
in the given line. If the columns are equal, a
single caret is shown.
Parameters: buf The buffer to be written to. line The current line number. beginColumn The column to mark from. endColumn The column to mark to.
Parameters: buf The buffer to be written to. line The current line number.