jdepend.textui

Class JDepend

public class JDepend extends Object

The JDepend class analyzes directories of Java class files, generates metrics for each Java package, and reports the metrics in a textual format.

Author: Mike Clark (mike@clarkware.com) Clarkware Consulting, Inc.

Field Summary
protected NumberFormatformatter
Constructor Summary
JDepend()
Constructs a JDepend instance using standard output.
JDepend(PrintWriter writer)
Constructs a JDepend instance with the specified writer.
Method Summary
voidaddDirectory(String name)
Adds the specified directory name to the collection of directories to be analyzed.
voidanalyze()
Analyzes the registered directories, generates metrics for each Java package, and reports the metrics.
voidanalyzeInnerClasses(boolean b)
Determines whether inner classes are analyzed.
protected PrintWritergetWriter()
protected voidinstanceMain(String[] args)
static voidmain(String[] args)
Main.
protected voidprintAbstractClasses(JavaPackage jPackage)
protected voidprintAbstractClassesFooter()
protected voidprintAbstractClassesHeader()
protected voidprintAfferents(JavaPackage jPackage)
protected voidprintAfferentsError()
protected voidprintAfferentsFooter()
protected voidprintAfferentsHeader()
protected voidprintClassName(JavaClass jClass)
protected voidprintConcreteClasses(JavaPackage jPackage)
protected voidprintConcreteClassesFooter()
protected voidprintConcreteClassesHeader()
protected voidprintCycle(JavaPackage jPackage)
protected voidprintCycleContributor(JavaPackage jPackage)
protected voidprintCycleFooter()
protected voidprintCycleHeader(JavaPackage jPackage)
protected voidprintCycles(Collection packages)
protected voidprintCyclesFooter()
protected voidprintCyclesHeader()
protected voidprintCycleTarget(JavaPackage jPackage)
protected voidprintEfferents(JavaPackage jPackage)
protected voidprintEfferentsError()
protected voidprintEfferentsFooter()
protected voidprintEfferentsHeader()
protected voidprintFooter()
protected voidprintHeader()
protected voidprintNoStats()
protected voidprintPackage(JavaPackage jPackage)
protected voidprintPackageFooter(JavaPackage jPackage)
protected voidprintPackageHeader(JavaPackage jPackage)
protected voidprintPackageName(JavaPackage jPackage)
protected voidprintPackages(Collection packages)
protected voidprintPackagesFooter()
protected voidprintPackagesHeader()
protected voidprintSectionBreak()
protected voidprintStatistics(JavaPackage jPackage)
protected voidprintSummary(Collection packages)
voidsetFilter(PackageFilter filter)
Sets the package filter.
voidsetWriter(PrintWriter writer)
Sets the output writer.
protected Stringtab()
protected Stringtab(int n)
protected StringtoFormattedString(float f)
protected voidusage(String message)

Field Detail

formatter

protected NumberFormat formatter

Constructor Detail

JDepend

public JDepend()
Constructs a JDepend instance using standard output.

JDepend

public JDepend(PrintWriter writer)
Constructs a JDepend instance with the specified writer.

Parameters: writer Writer.

Method Detail

addDirectory

public void addDirectory(String name)
Adds the specified directory name to the collection of directories to be analyzed.

Parameters: name Directory name.

Throws: IOException If the directory does not exist.

analyze

public void analyze()
Analyzes the registered directories, generates metrics for each Java package, and reports the metrics.

analyzeInnerClasses

public void analyzeInnerClasses(boolean b)
Determines whether inner classes are analyzed.

Parameters: b true to analyze inner classes; false otherwise.

getWriter

protected PrintWriter getWriter()

instanceMain

protected void instanceMain(String[] args)

main

public static void main(String[] args)
Main.

printAbstractClasses

protected void printAbstractClasses(JavaPackage jPackage)

printAbstractClassesFooter

protected void printAbstractClassesFooter()

printAbstractClassesHeader

protected void printAbstractClassesHeader()

printAfferents

protected void printAfferents(JavaPackage jPackage)

printAfferentsError

protected void printAfferentsError()

printAfferentsFooter

protected void printAfferentsFooter()

printAfferentsHeader

protected void printAfferentsHeader()

printClassName

protected void printClassName(JavaClass jClass)

printConcreteClasses

protected void printConcreteClasses(JavaPackage jPackage)

printConcreteClassesFooter

protected void printConcreteClassesFooter()

printConcreteClassesHeader

protected void printConcreteClassesHeader()

printCycle

protected void printCycle(JavaPackage jPackage)

printCycleContributor

protected void printCycleContributor(JavaPackage jPackage)

printCycleFooter

protected void printCycleFooter()

printCycleHeader

protected void printCycleHeader(JavaPackage jPackage)

printCycles

protected void printCycles(Collection packages)

printCyclesFooter

protected void printCyclesFooter()

printCyclesHeader

protected void printCyclesHeader()

printCycleTarget

protected void printCycleTarget(JavaPackage jPackage)

printEfferents

protected void printEfferents(JavaPackage jPackage)

printEfferentsError

protected void printEfferentsError()

printEfferentsFooter

protected void printEfferentsFooter()

printEfferentsHeader

protected void printEfferentsHeader()

printFooter

protected void printFooter()

printHeader

protected void printHeader()

printNoStats

protected void printNoStats()

printPackage

protected void printPackage(JavaPackage jPackage)

printPackageFooter

protected void printPackageFooter(JavaPackage jPackage)

printPackageHeader

protected void printPackageHeader(JavaPackage jPackage)

printPackageName

protected void printPackageName(JavaPackage jPackage)

printPackages

protected void printPackages(Collection packages)

printPackagesFooter

protected void printPackagesFooter()

printPackagesHeader

protected void printPackagesHeader()

printSectionBreak

protected void printSectionBreak()

printStatistics

protected void printStatistics(JavaPackage jPackage)

printSummary

protected void printSummary(Collection packages)

setFilter

public void setFilter(PackageFilter filter)
Sets the package filter.

Parameters: filter Package filter.

setWriter

public void setWriter(PrintWriter writer)
Sets the output writer.

Parameters: writer Output writer.

tab

protected String tab()

tab

protected String tab(int n)

toFormattedString

protected String toFormattedString(float f)

usage

protected void usage(String message)
Copyright B) 1999-2003 Clarkware Consulting, Inc.