|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavancss.Javancss
public class Javancss
While the Java parser class might be the heart of JavaNCSS, this class is the brain. This class controls input and output and invokes the Java parser.
Field Summary | |
---|---|
private java.lang.Object[] |
_aoPackage
|
private boolean |
_bExit
|
private boolean |
_bXML
|
private java.util.Map |
_htPackages
|
private int |
_loc
|
private int |
_ncss
|
private ccl.util.Init |
_pInit
|
private JavaParser |
_pJavaParser
|
private java.lang.String |
_sErrorMessage
|
private java.io.File |
_sJavaSourceFile
Just used for parseImports. |
private java.lang.Throwable |
_thrwError
|
private java.util.List |
_vFunctionMetrics
|
private java.util.List |
_vImports
|
private java.util.List |
_vJavaSourceFiles
|
private java.util.List |
_vObjectMetrics
|
private java.util.List |
_vPackageMetrics
|
private java.lang.String |
encoding
|
private static java.lang.String |
S_INIT__FILE_CONTENT
|
Constructor Summary | |
---|---|
Javancss()
Only way to create object that does not immediately start to parse. |
|
Javancss(java.io.File sJavaSourceFile_)
|
|
Javancss(java.util.List vJavaSourceFiles_)
|
|
Javancss(java.io.Reader reader)
|
|
Javancss(java.lang.String[] asArgs_,
java.lang.String sRcsHeader_)
This is the constructor used in the main routine in javancss.Main. |
Method Summary | |
---|---|
private static void |
_addJavaFiles(java.io.File dir,
java.util.List v)
recursively adds *.java files |
private void |
_measureFiles(java.util.List vJavaSourceFiles_)
|
private void |
_measureRoot(java.io.Reader reader)
If arguments were provided, they are used, otherwise the input stream is used. |
private void |
_measureSource(java.io.File sSourceFile_)
|
private void |
_measureSource(java.io.Reader reader)
|
private java.io.Reader |
createSourceReader(java.io.File sSourceFile_)
|
private java.util.List |
findFiles(java.util.List filenames,
boolean recursive)
|
java.lang.String |
getEncoding()
|
Formatter |
getFormatter()
|
java.util.List |
getFunctionMetrics()
|
java.util.List |
getFunctions()
The same as getFunctionMetrics?! |
java.util.List |
getImports()
|
int |
getJdcl()
JDCL stands for javadoc comment lines (while jvdc stands for number of javadoc comments). |
int |
getJvdc()
|
java.lang.Throwable |
getLastError()
|
java.lang.String |
getLastErrorMessage()
|
int |
getLOC()
|
int |
getMl()
|
int |
getNcss()
|
java.util.List |
getObjectMetrics()
|
java.lang.Object[] |
getPackage()
Return info about package statement. |
java.util.List |
getPackageMetrics()
Returns list of packages in the form PackageMetric objects. |
int |
getSl()
|
private java.io.Reader |
newReader(java.io.File file)
|
private java.io.Reader |
newReader(java.io.InputStream stream)
|
boolean |
parseImports()
|
java.lang.String |
printFunctionNcss()
|
java.lang.String |
printJavaNcss()
|
java.lang.String |
printObjectNcss()
|
java.lang.String |
printPackageNcss()
|
void |
setEncoding(java.lang.String encoding)
|
void |
setExit()
|
void |
setSourceFile(java.io.File javaSourceFile_)
|
void |
setXML(boolean bXML)
|
boolean |
useXML()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String S_INIT__FILE_CONTENT
private boolean _bExit
private java.util.List _vJavaSourceFiles
private java.lang.String encoding
private java.lang.String _sErrorMessage
private java.lang.Throwable _thrwError
private JavaParser _pJavaParser
private int _ncss
private int _loc
private java.util.List _vFunctionMetrics
private java.util.List _vObjectMetrics
private java.util.List _vPackageMetrics
private java.util.List _vImports
private java.util.Map _htPackages
private java.lang.Object[] _aoPackage
private java.io.File _sJavaSourceFile
private ccl.util.Init _pInit
private boolean _bXML
Constructor Detail |
---|
public Javancss(java.util.List vJavaSourceFiles_)
public Javancss(java.io.File sJavaSourceFile_)
public Javancss()
public Javancss(java.io.Reader reader)
public Javancss(java.lang.String[] asArgs_, java.lang.String sRcsHeader_) throws java.io.IOException
java.io.IOException
Method Detail |
---|
private java.io.Reader createSourceReader(java.io.File sSourceFile_)
private void _measureSource(java.io.File sSourceFile_) throws java.io.IOException, ParseException, TokenMgrError
java.io.IOException
ParseException
TokenMgrError
private void _measureSource(java.io.Reader reader) throws java.io.IOException, ParseException, TokenMgrError
java.io.IOException
ParseException
TokenMgrError
private void _measureFiles(java.util.List vJavaSourceFiles_) throws java.io.IOException, ParseException, TokenMgrError
java.io.IOException
ParseException
TokenMgrError
private void _measureRoot(java.io.Reader reader) throws java.io.IOException, ParseException, TokenMgrError
java.io.IOException
ParseException
TokenMgrError
public java.util.List getImports()
public java.lang.Object[] getPackage()
public java.util.List getFunctions()
public java.lang.String printObjectNcss()
public java.lang.String printFunctionNcss()
public java.lang.String printPackageNcss()
public java.lang.String printJavaNcss()
public boolean parseImports()
public void setSourceFile(java.io.File javaSourceFile_)
private static void _addJavaFiles(java.io.File dir, java.util.List v)
dir
- the base directory to searchv
- the list of file to add found files toprivate java.util.List findFiles(java.util.List filenames, boolean recursive) throws java.io.IOException
java.io.IOException
public int getNcss()
public int getLOC()
public int getJvdc()
public int getJdcl()
public int getSl()
public int getMl()
public java.util.List getFunctionMetrics()
public java.util.List getObjectMetrics()
public java.util.List getPackageMetrics()
public java.lang.String getLastErrorMessage()
public java.lang.Throwable getLastError()
public void setExit()
setExit
in interface ccl.util.Exitable
public void setXML(boolean bXML)
public boolean useXML()
public Formatter getFormatter()
public java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding)
private java.io.Reader newReader(java.io.InputStream stream) throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
private java.io.Reader newReader(java.io.File file) throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException
java.io.FileNotFoundException
java.io.UnsupportedEncodingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |