rj.tools.jcsc.formatter
Class AbstractResultsFormatter

java.lang.Object
  extended byrj.tools.jcsc.formatter.AbstractResultsFormatter
All Implemented Interfaces:
ResultsFormatter
Direct Known Subclasses:
ConsoleResultsFormatter, XMLResultsFormatter

public abstract class AbstractResultsFormatter
extends java.lang.Object
implements ResultsFormatter

AbstractResultsFormatter - Shows the results on the console in a compiler typcial way

Version:
__0.98.1__
Author:
Ralph Jocham

Field Summary
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 Summary
AbstractResultsFormatter()
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface rj.tools.jcsc.ResultsFormatter
format
 

Field Detail

mOutputStream

protected java.io.OutputStream mOutputStream
mOutputStream is the stream to write the formated output


mAuthors

protected java.lang.String mAuthors
mAuthors the authors of that class; if several authors then names are separated by ','


mViolations

protected java.util.List mViolations
mViolations the collection of all violations


mMethodMetrics

protected java.util.List mMethodMetrics
mMethodMetrics the collection of all metrics


mPackage

protected java.lang.String mPackage
mPackage the package the class belongs to


mClass

protected java.lang.String mClass
mClass the name of the class


mViolationsCount

protected int mViolationsCount
mViolationsCount the number of vioalations


mUnitTestClassCount

protected int mUnitTestClassCount
mUnitTestClassCount the number of Unit test classes


mUnitTestsCount

protected int mUnitTestsCount
mUnitTestsCount the number of Unit tests


mNCSSCount

protected int mNCSSCount
mNCSSCount the number of NCSS (non commenting source statements)


mLineCount

protected int mLineCount
mLineCount the number of Lines


mMethodsCount

protected int mMethodsCount
mNCSSCount the number of methods (non commenting source statements)


mBatchSummary

protected BatchSummary mBatchSummary
all data from the batchrun


mViolationsSorter

protected ViolationsSorter mViolationsSorter
Encapsulation of sorting algorithmus for violations

Constructor Detail

AbstractResultsFormatter

public AbstractResultsFormatter()
Method Detail

setOutputStream

public void setOutputStream(java.io.OutputStream os)
setOutputStream

Specified by:
setOutputStream in interface ResultsFormatter
Parameters:
os - an OutputStream value
See Also:
ResultsFormatter

setAuthors

public void setAuthors(java.util.List authors)
setAuthors

Specified by:
setAuthors in interface ResultsFormatter
Parameters:
authors - a Collection value
See Also:
ResultsFormatter

setViolations

public void setViolations(java.util.List violations)
setViolations

Specified by:
setViolations in interface ResultsFormatter
Parameters:
violations - a Collection value
See Also:
ResultsFormatter

setMethodMetrics

public void setMethodMetrics(java.util.List metrics)
setMethodMetrics

Specified by:
setMethodMetrics in interface ResultsFormatter
Parameters:
metrics - a Collection value
See Also:
ResultsFormatter

setPackage

public void setPackage(java.lang.String name)
setPackage

Specified by:
setPackage in interface ResultsFormatter
Parameters:
name - a String value
See Also:
ResultsFormatter

setClassName

public void setClassName(java.lang.String name)
setClassName

Specified by:
setClassName in interface ResultsFormatter
Parameters:
name - a String value
See Also:
ResultsFormatter

setViolationsCount

public void setViolationsCount(int count)
setViolationsCount

Specified by:
setViolationsCount in interface ResultsFormatter
Parameters:
count - an int value
See Also:
ResultsFormatter

setUnitTestClassCount

public void setUnitTestClassCount(int count)
setUnitTestClassCount

Specified by:
setUnitTestClassCount in interface ResultsFormatter
Parameters:
count - an int value
See Also:
ResultsFormatter

setUnitTestsCount

public void setUnitTestsCount(int count)
setUnitTestsCount

Specified by:
setUnitTestsCount in interface ResultsFormatter
Parameters:
count - an int value
See Also:
ResultsFormatter

setNCSSCount

public void setNCSSCount(int count)
setNCSSCount

Specified by:
setNCSSCount in interface ResultsFormatter
Parameters:
count - an int value
See Also:
ResultsFormatter

setLineCount

public void setLineCount(int count)
setLineCount

Specified by:
setLineCount in interface ResultsFormatter
Parameters:
count - an int value
See Also:
ResultsFormatter

setMethodsCount

public void setMethodsCount(int count)
setMethodsCount

Specified by:
setMethodsCount in interface ResultsFormatter
Parameters:
count - an int value
See Also:
ResultsFormatter

setViolationSorter

public void setViolationSorter(ViolationsSorter sorter)
Set the algorithm for how the violations shall be sorted

Specified by:
setViolationSorter in interface ResultsFormatter
Parameters:
sorter -

setBatchMode

public void setBatchMode(BatchSummary batchSummary)
Set that the JCSC was in batch mode and pass in the associated data

Specified by:
setBatchMode in interface ResultsFormatter
Parameters:
batchSummary -

isBatchMode

protected boolean isBatchMode()
in batch mode

Returns:
true if in batch mode; false otherwise

formatBatch

public void formatBatch()
Format the batch run results. This method is additionally called to each call format() for each parsed file. This method should be used to generate additionally.

Specified by:
formatBatch in interface ResultsFormatter


(c) 1999-2005 by Ralph Jocham (rjocham72@netscape.net)
JCSC is released under the terms of the GNU General Public License