public abstract class AbstractResultsFormatter extends java.lang.Object implements ResultsFormatter
AbstractResultsFormatter
- Shows the results on the console in a compiler
typcial wayModifier and Type | Field and Description |
---|---|
protected java.lang.String |
mAuthors
mAuthors the authors of that class; if several authors
then names are separated by ',' |
protected BatchSummary |
mBatchSummary
all data from the batchrun
|
protected java.lang.String |
mClass
mClass the name of the class |
protected int |
mLineCount
mLineCount the number of Lines |
protected java.util.List |
mMethodMetrics
mMethodMetrics the collection of all metrics |
protected int |
mMethodsCount
mNCSSCount the number of methods (non commenting source statements) |
protected int |
mNCSSCount
mNCSSCount the number of NCSS (non commenting source statements) |
protected java.io.OutputStream |
mOutputStream
mOutputStream is the stream to write the formated output |
protected java.lang.String |
mPackage
mPackage the package the class belongs to |
protected int |
mUnitTestClassCount
mUnitTestClassCount the number of Unit test classes |
protected int |
mUnitTestsCount
mUnitTestsCount the number of Unit tests |
protected java.util.List |
mViolations
mViolations the collection of all violations |
protected int |
mViolationsCount
mViolationsCount the number of vioalations |
protected ViolationsSorter |
mViolationsSorter
Encapsulation of sorting algorithmus for violations
|
Constructor and Description |
---|
AbstractResultsFormatter() |
Modifier and Type | Method and Description |
---|---|
void |
formatBatch()
Format the batch run results.
|
protected boolean |
isBatchMode()
in batch mode
|
void |
setAuthors(java.util.List authors)
setAuthors |
void |
setBatchMode(BatchSummary batchSummary)
Set that the JCSC was in batch mode and pass in the associated
data
|
void |
setClassName(java.lang.String name)
setClassName |
void |
setLineCount(int count)
setLineCount |
void |
setMethodMetrics(java.util.List metrics)
setMethodMetrics |
void |
setMethodsCount(int count)
setMethodsCount |
void |
setNCSSCount(int count)
setNCSSCount |
void |
setOutputStream(java.io.OutputStream os)
setOutputStream |
void |
setPackage(java.lang.String name)
setPackage |
void |
setUnitTestClassCount(int count)
setUnitTestClassCount |
void |
setUnitTestsCount(int count)
setUnitTestsCount |
void |
setViolations(java.util.List violations)
setViolations |
void |
setViolationsCount(int count)
setViolationsCount |
void |
setViolationSorter(ViolationsSorter sorter)
Set the algorithm for how the violations shall be sorted
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
format
protected java.io.OutputStream mOutputStream
mOutputStream
is the stream to write the formated outputprotected java.lang.String mAuthors
mAuthors
the authors of that class; if several authors
then names are separated by ','protected java.util.List mViolations
mViolations
the collection of all violationsprotected java.util.List mMethodMetrics
mMethodMetrics
the collection of all metricsprotected java.lang.String mPackage
mPackage
the package the class belongs toprotected java.lang.String mClass
mClass
the name of the classprotected int mViolationsCount
mViolationsCount
the number of vioalationsprotected int mUnitTestClassCount
mUnitTestClassCount
the number of Unit test classesprotected int mUnitTestsCount
mUnitTestsCount
the number of Unit testsprotected int mNCSSCount
mNCSSCount
the number of NCSS (non commenting source statements)protected int mLineCount
mLineCount
the number of Linesprotected int mMethodsCount
mNCSSCount
the number of methods (non commenting source statements)protected BatchSummary mBatchSummary
protected ViolationsSorter mViolationsSorter
public void setOutputStream(java.io.OutputStream os)
setOutputStream
setOutputStream
in interface ResultsFormatter
os
- an OutputStream
valueResultsFormatter
public void setAuthors(java.util.List authors)
setAuthors
setAuthors
in interface ResultsFormatter
authors
- a Collection
valueResultsFormatter
public void setViolations(java.util.List violations)
setViolations
setViolations
in interface ResultsFormatter
violations
- a Collection
valueResultsFormatter
public void setMethodMetrics(java.util.List metrics)
setMethodMetrics
setMethodMetrics
in interface ResultsFormatter
metrics
- a Collection
valueResultsFormatter
public void setPackage(java.lang.String name)
setPackage
setPackage
in interface ResultsFormatter
name
- a String
valueResultsFormatter
public void setClassName(java.lang.String name)
setClassName
setClassName
in interface ResultsFormatter
name
- a String
valueResultsFormatter
public void setViolationsCount(int count)
setViolationsCount
setViolationsCount
in interface ResultsFormatter
count
- an int
valueResultsFormatter
public void setUnitTestClassCount(int count)
setUnitTestClassCount
setUnitTestClassCount
in interface ResultsFormatter
count
- an int
valueResultsFormatter
public void setUnitTestsCount(int count)
setUnitTestsCount
setUnitTestsCount
in interface ResultsFormatter
count
- an int
valueResultsFormatter
public void setNCSSCount(int count)
setNCSSCount
setNCSSCount
in interface ResultsFormatter
count
- an int
valueResultsFormatter
public void setLineCount(int count)
setLineCount
setLineCount
in interface ResultsFormatter
count
- an int
valueResultsFormatter
public void setMethodsCount(int count)
setMethodsCount
setMethodsCount
in interface ResultsFormatter
count
- an int
valueResultsFormatter
public void setViolationSorter(ViolationsSorter sorter)
setViolationSorter
in interface ResultsFormatter
sorter
- public void setBatchMode(BatchSummary batchSummary)
setBatchMode
in interface ResultsFormatter
batchSummary
- protected boolean isBatchMode()
public void formatBatch()
formatBatch
in interface ResultsFormatter
JCSC is released under the terms of the GNU General Public License