public class Analyser extends Object
| Constructor and Description |
|---|
Analyser(String[] classFiles)
Creates an instance for the specified files or folders.
|
Analyser(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. |
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
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(String[] args)
Main method of the Analyser.
|
void |
printComponents(PrintWriter writer,
int minSize)
Prints for each strong component of the class graph a raw output into
the specified writer.
|
void |
printCSV(PrintWriter writer)
Prints a CSV report into the specified writer.
|
void |
printRaw(PrintWriter writer)
Prints for each class a raw output into the specified writer.
|
void |
printXML(String title,
boolean packagesOnly,
PrintWriter writer)
Prints an XML report into the specified writer.
|
void |
readAndAnalyse(boolean packagesOnly)
Reads and analyses class files.
|
public Analyser(String[] classFiles)
classFiles - Absolute or relative file names.public Analyser(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 classpublic long createClassGraph()
throws IOException
IOException - if a problem occured during readingpublic AtomicVertex[] getClassGraph()
createClassGraph() if not
already invoked.public int getNumberOfExternalClasses()
public long condenseClassGraph()
IllegalStateException - if this method is called before
createClassGraph().public StrongComponent[] getCondensedClassGraph()
IllegalStateException - if this method is called before
createClassGraph().public long calculateClassLayerMap()
IllegalStateException - if this method is called before
createClassGraph().public Map getClassLayerMap()
AtomicVertex)
and the layer indices are the values (type Integer).IllegalStateException - if this method is called before
createClassGraph().public long createPackageGraph()
IllegalStateException - if this method is called before
createClassGraph().public void printCSV(PrintWriter writer)
writer - Output stream.public void printRaw(PrintWriter writer)
writer - Output stream.public void printComponents(PrintWriter writer, int minSize)
writer - Output stream.minSize - Minimum size of the strong component.IllegalStateException - if this method is called before
createClassGraph().public AtomicVertex[] getPackageGraph()
IllegalStateException - if this method is called before
createClassGraph().public long condensePackageGraph()
IllegalStateException - if this method is called before
createPackageGraph().public StrongComponent[] getCondensedPackageGraph()
IllegalStateException - if this method is called before
createPackageGraph().public long calculatePackageLayerMap()
IllegalStateException - if this method is called before
createPackageGraph().public Map getPackageLayerMap()
AtomicVertex)
and the layer indices are the values (type Integer).IllegalStateException - if this method is called before
createPackageGraph().public void readAndAnalyse(boolean packagesOnly)
throws IOException
IOException - in case of reading problems.public void printXML(String title, boolean packagesOnly, PrintWriter writer)
title - Title of the report.packagesOnly - if true classes are omitted.writer - Output stream.IllegalStateException - if this method is called before
createPackageGraph().Copyright © 2014. All rights reserved.