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