|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectclassycle.Analyser
public class Analyser
Main class of the Classycle tool. Runs on the command line and produces a report.
Constructor Summary | |
---|---|
Analyser(java.lang.String[] classFiles)
Creates an instance for the specified files or folders. |
|
Analyser(java.lang.String[] classFiles,
StringPattern pattern,
StringPattern reflectionPattern,
boolean mergeInnerClasses)
Creates an instance for the specified files or folders which are filtered by the specified StringPattern object. |
Method Summary | |
---|---|
long |
calculateClassLayerMap()
Calculates the for each class its layer index. |
long |
calculatePackageLayerMap()
Calculates the for each package its layer index. |
long |
condenseClassGraph()
Condenses the class graph to an acyclic graph of its strong components. |
long |
condensePackageGraph()
Condenses the package graph to an acyclic graph of its strong components. |
long |
createClassGraph()
Parses the class files and creates the class graph. |
long |
createPackageGraph()
Creates the package graph from the class graph. |
AtomicVertex[] |
getClassGraph()
Returns the class graph. |
java.util.Map |
getClassLayerMap()
Calculates the for each class its layer index and returns a Map where the classes are the keys (type AtomicVertex )
and the layer indices are the values (type Integer). |
StrongComponent[] |
getCondensedClassGraph()
Returns the condensed the class graph, i.e. the acyclic graph of its strong components. |
StrongComponent[] |
getCondensedPackageGraph()
Returns the condensed package graph, i.e. the acyclic graph of its strong components. |
int |
getNumberOfExternalClasses()
Counts the number of external classes. |
AtomicVertex[] |
getPackageGraph()
Returns the package graph created the class graph. |
java.util.Map |
getPackageLayerMap()
Calculates the for each package its layer index and returns a Map where the packages are the keys (type AtomicVertex )
and the layer indices are the values (type Integer). |
static void |
main(java.lang.String[] args)
Main method of the Analyser. |
void |
printComponents(java.io.PrintWriter writer,
int minSize)
Prints for each strong component of the class graph a raw output into the specified writer. |
void |
printCSV(java.io.PrintWriter writer)
Prints a CSV report into the specified writer. |
void |
printRaw(java.io.PrintWriter writer)
Prints for each class a raw output into the specified writer. |
void |
printXML(java.lang.String title,
boolean packagesOnly,
java.io.PrintWriter writer)
Prints an XML report into the specified writer. |
void |
readAndAnalyse(boolean packagesOnly)
Reads and analyses class files. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Analyser(java.lang.String[] classFiles)
classFiles
- Absolute or relative file names.public Analyser(java.lang.String[] classFiles, StringPattern pattern, StringPattern reflectionPattern, boolean mergeInnerClasses)
StringPattern
object.
classFiles
- Absolute or relative file names.pattern
- Pattern fully-qualified class name have to match in order
to be a part of the class graph.reflectionPattern
- Pattern ordinary string constants of a class
file have to fullfill in order to be handled as a class references.
In addition such strings have to be syntactically valid
fully qualified class names. If null ordinary string
constants will not be checked.mergeInnerClasses
- If true
merge inner classes with its outer classMethod Detail |
---|
public long createClassGraph() throws java.io.IOException
java.io.IOException
- if a problem occured during readingpublic AtomicVertex[] getClassGraph()
createClassGraph()
if not
already invoked.
public int getNumberOfExternalClasses()
public long condenseClassGraph()
java.lang.IllegalStateException
- if this method is called before
createClassGraph()
.public StrongComponent[] getCondensedClassGraph()
java.lang.IllegalStateException
- if this method is called before
createClassGraph()
.public long calculateClassLayerMap()
java.lang.IllegalStateException
- if this method is called before
createClassGraph()
.public java.util.Map getClassLayerMap()
AtomicVertex
)
and the layer indices are the values (type Integer).
java.lang.IllegalStateException
- if this method is called before
createClassGraph()
.public long createPackageGraph()
java.lang.IllegalStateException
- if this method is called before
createClassGraph()
.public void printCSV(java.io.PrintWriter writer)
writer
- Output stream.public void printRaw(java.io.PrintWriter writer)
writer
- Output stream.public void printComponents(java.io.PrintWriter writer, int minSize)
writer
- Output stream.minSize
- Minimum size of the strong component.
java.lang.IllegalStateException
- if this method is called before
createClassGraph()
.public AtomicVertex[] getPackageGraph()
java.lang.IllegalStateException
- if this method is called before
createClassGraph()
.public long condensePackageGraph()
java.lang.IllegalStateException
- if this method is called before
createPackageGraph()
.public StrongComponent[] getCondensedPackageGraph()
java.lang.IllegalStateException
- if this method is called before
createPackageGraph()
.public long calculatePackageLayerMap()
java.lang.IllegalStateException
- if this method is called before
createPackageGraph()
.public java.util.Map getPackageLayerMap()
AtomicVertex
)
and the layer indices are the values (type Integer).
java.lang.IllegalStateException
- if this method is called before
createPackageGraph()
.public void readAndAnalyse(boolean packagesOnly) throws java.io.IOException
java.io.IOException
- in case of reading problems.public void printXML(java.lang.String title, boolean packagesOnly, java.io.PrintWriter writer)
title
- Title of the report.packagesOnly
- if true classes are omitted.writer
- Output stream.
java.lang.IllegalStateException
- if this method is called before
createPackageGraph()
.public static void main(java.lang.String[] args) throws java.lang.Exception
args
- command line arguments.
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |