Tools in Dependency Finder

For Dependency Finder version 1.2.1-beta4.


Table of Contents

Alphabetical Dependencies Metrics API Differences Classfile Utilities

ClassClassDiff

Computes API differences between two classes.

Synopsis

    ClassClassDiff
        [-code]
        [-dtd-prefix uri]
        [-echo]
        [-encoding name]
        [-filter filename]
        [-help]
        [-indent-text text]
        [-level value]
        [-name value]
        [-new filename]+
        [-new-label value]
        [-old filename]+
        [-old-label value]
        [-out filename]
        [-time]
        [-verbose [filename]]
        [-version]

Description

Takes two classes and computes the API changes between them. The first class is considered the "old" code and the second class is considered the "new" code. The result is an XML document listing the changes. You can use DiffToHTML to render the report in HTML.

Sometimes, as you are doing refactoring, you might wonder what the impact will be on some class. You can save it under a different name, make the changes, compile both the original and new versions together, and use this tool to compare them.

You can use -level incompatible to have an analysis that list only "public" changes that might not be backwards compatible.

Switches

-code

Show differences that only appear in code but did not impact the API, such as bytecode changes or different constant values.

Mandatory:no
Multiples:no
Default value:none

-dtd-prefix uri

The prefix of the DTD URL for the XML output document.

Mandatory:no
Multiples:no
Default value:http://depfind.sourceforge.net/dtd

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-encoding name

The encoding used for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:utf-8

-filter filename

Location of the file with the list of programming elements that the tool should limit itself to. If omitted, the tool reports on all programming elements.

Mandatory:no
Multiples:no
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-indent-text text

Uses text for each indentation level in XML output.

Mandatory:no
Multiples:no
Default value:Four spaces, "    "

-level value

Tells JarJarDiff which strategy to use to determine differences.

There are two special values for the predefined values for the strategies that come with Dependency Finder:

api
Shows all API differences. Same as com.jeantessier.diff.APIDifferenceStrategy.
incompatible
Shows only differences that would be incompatible with the old version. Same as com.jeantessier.diff.IncompatibleDifferenceStrategy.

If value is not one of the special values above, it is treated as the name of a class. JarJarDiff will try to instantiate this class using a default constructor and cast it to DifferenceStrategy. If this fails anywhere along the way, it will fall back on the default value listed below.

Mandatory:no
Multiples:no
Default value:api

-name value

Project name for the report.

Mandatory:no
Multiples:no
Default value:none

-new filename

File names for JAR files, Zip files, and .class files for the tool to read. You can also give directory names, the tool will search them for JAR files, Zip files, and .class files. They make up the new version of the codebase.

Mandatory:yes
Multiples:yes
Default value:none

-new-label value

Version name for the report.

Mandatory:no
Multiples:no
Default value:value of -new

-old filename

File names for JAR files, Zip files, and .class files for the tool to read. You can also give directory names, the tool will search them for JAR files, Zip files, and .class files. They make up the old version of the codebase.

Mandatory:yes
Multiples:yes
Default value:true

-old-label value

Version name for the report.

Mandatory:no
Multiples:no
Default value:value of -old

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

It writes all differences into an XML document that follows the differences DTD.

Examples

This will compare OldClass.class to NewClass.class and write the report to result.xml. The title will say "Version OldClass to Version NewClass".

    ClassClassDiff -old OldClass.class -new NewClass.class -out report.xml
    DiffToHTML -in report.xml -out report.html

Class

com.jeantessier.dependencyfinder.cli.ClassClassDiff


ClassDump

Takes a class name and dumps the associated files content as hexadecimal characters to standard output.

Synopsis

    ClassDump
        [classname ...]

Description

For each class named as a parameter, the tool obtains a java.lang.Class instance. From it, the tool can get the .class file used by the ClassLoader. The tool reads bytes from the .class file one at a time and writes the corresponding hexadecimal character pair to standard output.

Switches

none

Parameters

Fully qualified class names. The classes must be available on the CLASSPATH.

Mandatory:no
Multiple:yes
Default value:com.jeantessier.dependencyfinder.cli.ClassDump

Output

Hexadecimal text of the classfile whose name is passed in.

Examples

    ClassDump test
    test:
    test.class -> file:/C:/language/Java/myprojects/DependencyFinder/classes/test.class
    CAFEBABE 0000002E 002C0A00 02001907 001A0A00 1B001C07 001D0900 1E001F0A 
    00200021 07002201 00063C69 6E69743E 01000328 29560100 04436F64 6501000F 
    4C696E65 4E756D62 65725461 626C6501 00124C6F 63616C56 61726961 626C6554 
    61626C65 01000474 68697301 00064C74 6573743B 0100046D 61696E01 0016285B 
    4C6A6176 612F6C61 6E672F53 7472696E 673B2956 01000461 72677301 00135B4C 
    6A617661 2F6C616E 672F5374 72696E67 3B010001 63010016 4C6A6176 612F7574 
    696C2F43 6F6C6C65 6374696F 6E3B0100 02657801 00204C6A 6176612F 6C616E67 
    2F4E756C 6C506F69 6E746572 45786365 7074696F 6E3B0100 0A536F75 72636546 
    696C6501 00097465 73742E6A 6176610C 00080009 0100106A 6176612F 6C616E67 
    2F4F626A 65637407 00230C00 24002501 001E6A61 76612F6C 616E672F 4E756C6C 
    506F696E 74657245 78636570 74696F6E 0700260C 00270028 0700290C 002A002B 
    01000474 65737401 00156A61 76612F75 74696C2F 436F6C6C 65637469 6F6E7301 
    00097369 6E676C65 746F6E01 0023284C 6A617661 2F6C616E 672F4F62 6A656374 
    3B294C6A 6176612F 7574696C 2F536574 3B010010 6A617661 2F6C616E 672F5379 
    7374656D 0100036F 75740100 154C6A61 76612F69 6F2F5072 696E7453 74726561 
    6D3B0100 136A6176 612F696F 2F507269 6E745374 7265616D 01000770 72696E74 
    6C6E0100 15284C6A 6176612F 6C616E67 2F4F626A 6563743B 29560021 00070002 
    00000000 00020001 00080009 0001000A 0000002F 00010001 00000005 2AB70001 
    B1000000 02000B00 00000600 01000000 23000C00 00000C00 01000000 05000D00 
    0E000000 09000F00 10000100 0A000000 70000200 02000000 1ABB0002 59B70001 
    B800034C A7000E4C B200052B B60006A7 0003B100 01000000 0B000E00 04000200 
    0B000000 16000500 00002600 0B002700 0E002800 16002900 19002A00 0C000000 
    20000300 00001A00 11001200 00000B00 00001300 14000100 0F000A00 15001600 
    01000100 17000000 020018

Class

com.jeantessier.dependencyfinder.cli.ClassDump


ClassFinder

For each class it could find, prints where it found it.

Synopsis

    ClassFinder
        [-compact]
        [-echo]
        [-excludes value]*
        [-help]
        [-includes value]*
        [-indent-text text]
        [-out filename]
        [-time]
        [-verbose [filename]]
        [-version]
        [filename ...]

Description

Lists all the classes in a group of JAR file, Zip file, and directories along with the location(s) of each class. Similar to ClassList, this one shows where the class can be found, which JAR or directory.

You can also give it a .class file, but that would be trivial. It will just print the fully qualified name of the class in it.

You can use -includes and -excludes to limit the output to only those classes that interested you.

Switches

-compact

Prints compact output, one line per class.

Mandatory:no
Multiples:no
Default value:none

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-excludes value

The name of a package, class, or feature must NOT match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-includes value

The name of a package, class, or feature must match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value://

-indent-text text

Uses text for indentation when -compact is not in use.

Mandatory:no
Multiples:no
Default value:Four spaces, "    "

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

Parameters

File names for JAR files, Zip files, and .class files for the tool to read. You can also give directory names, the tool will search them for JAR files, Zip files, and .class files.

Mandatory:no
Multiples:yes
Default value:".", the current directory

Output

By default, lists the fully qualified class names for each class the tool could find. Each is followed by the location where if was found, each on its own line.

With -compact, lists the fully qualified class names, one per line, for each class the tool could find, followed by the location where if was found.

Examples

    ClassFinder classes\com\jeantessier\metrics classes\com\jeantessier\commandline
    com.jeantessier.commandline.AnyParameterStrategy: classes\com\jeantessier\commandline
    com.jeantessier.commandline.AtLeastParameterStrategy: classes\com\jeantessier\commandline
    com.jeantessier.commandline.AtMostParameterStrategy: classes\com\jeantessier\commandline
    com.jeantessier.commandline.CommandLine: classes\com\jeantessier\commandline
    com.jeantessier.commandline.CommandLineException: classes\com\jeantessier\commandline
    com.jeantessier.commandline.CommandLineSwitch: classes\com\jeantessier\commandline
    com.jeantessier.commandline.CommandLineSwitchBase: classes\com\jeantessier\commandline
    com.jeantessier.commandline.CommandLineUsage: classes\com\jeantessier\commandline
    com.jeantessier.commandline.CountingParameterStrategy: classes\com\jeantessier\commandline
    com.jeantessier.commandline.ExactlyParameterStrategy: classes\com\jeantessier\commandline
    com.jeantessier.commandline.MultipleValuesSwitch: classes\com\jeantessier\commandline
    com.jeantessier.commandline.NullParameterStrategy: classes\com\jeantessier\commandline
    com.jeantessier.commandline.OptionalValueSwitch: classes\com\jeantessier\commandline
    com.jeantessier.commandline.ParameterStrategy: classes\com\jeantessier\commandline
    com.jeantessier.commandline.SingleValueSwitch: classes\com\jeantessier\commandline
    com.jeantessier.commandline.ToggleSwitch: classes\com\jeantessier\commandline
    com.jeantessier.commandline.Visitable: classes\com\jeantessier\commandline
    com.jeantessier.commandline.Visitor: classes\com\jeantessier\commandline
    com.jeantessier.metrics.AccumulatorMeasurement: classes\com\jeantessier\metrics
    com.jeantessier.metrics.CSVPrinter: classes\com\jeantessier\metrics
    com.jeantessier.metrics.CollectionMeasurement: classes\com\jeantessier\metrics
    com.jeantessier.metrics.ContextAccumulatorMeasurement: classes\com\jeantessier\metrics
    com.jeantessier.metrics.CounterMeasurement: classes\com\jeantessier\metrics
    com.jeantessier.metrics.Measurement: classes\com\jeantessier\metrics
    com.jeantessier.metrics.MeasurementBase: classes\com\jeantessier\metrics
    com.jeantessier.metrics.MeasurementDescriptor: classes\com\jeantessier\metrics
    com.jeantessier.metrics.MeasurementVisitor: classes\com\jeantessier\metrics
    com.jeantessier.metrics.Metrics: classes\com\jeantessier\metrics
    com.jeantessier.metrics.MetricsComparator: classes\com\jeantessier\metrics
    com.jeantessier.metrics.MetricsConfiguration: classes\com\jeantessier\metrics
    com.jeantessier.metrics.MetricsConfigurationHandler: classes\com\jeantessier\metrics
    com.jeantessier.metrics.MetricsConfigurationLoader: classes\com\jeantessier\metrics
    com.jeantessier.metrics.MetricsEvent: classes\com\jeantessier\metrics
    com.jeantessier.metrics.MetricsFactory: classes\com\jeantessier\metrics
    com.jeantessier.metrics.MetricsGatherer: classes\com\jeantessier\metrics
    com.jeantessier.metrics.MetricsListener: classes\com\jeantessier\metrics
    com.jeantessier.metrics.NameListMeasurement: classes\com\jeantessier\metrics
    com.jeantessier.metrics.NbSubMetricsMeasurement: classes\com\jeantessier\metrics
    com.jeantessier.metrics.NullMeasurement: classes\com\jeantessier\metrics
    com.jeantessier.metrics.Printer: classes\com\jeantessier\metrics
    com.jeantessier.metrics.RatioMeasurement: classes\com\jeantessier\metrics
    com.jeantessier.metrics.StatisticalMeasurement: classes\com\jeantessier\metrics
    com.jeantessier.metrics.SubMetricsAccumulatorMeasurement: classes\com\jeantessier\metrics
    com.jeantessier.metrics.SumMeasurement: classes\com\jeantessier\metrics
    com.jeantessier.metrics.TextPrinter: classes\com\jeantessier\metrics
    com.jeantessier.metrics.XMLPrinter: classes\com\jeantessier\metrics

Class

com.jeantessier.dependencyfinder.cli.ClassFinder


ClassList

Lists all classes it could find, based on parameters.

Synopsis

    ClassList
        [-echo]
        [-help]
        [-out filename]
        [-time]
        [-verbose [filename]]
        [-version]
        [filename ...]

Description

Lists all the classes in a JAR file, Zip file, or directory.

You can also give it a .class file, but that would be trivial. It will just print the fully qualified name of the class in it.

Switches

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

Parameters

File names for JAR files, Zip files, and .class files for the tool to read. You can also give directory names, the tool will search them for JAR files, Zip files, and .class files.

Mandatory:no
Multiples:yes
Default value:".", the current directory

Output

List of fully qualified class names, one per line, for all the classes the tool could find.

Examples

    ClassList classes\com\jeantessier\metrics classes\com\jeantessier\commandline
    classes\com\jeantessier\metrics:
    com.jeantessier.metrics.AccumulatorMeasurement
    com.jeantessier.metrics.CSVPrinter
    com.jeantessier.metrics.CollectionMeasurement
    com.jeantessier.metrics.CounterMeasurement
    com.jeantessier.metrics.Measurement
    com.jeantessier.metrics.MeasurementBase
    com.jeantessier.metrics.MeasurementDescriptor
    com.jeantessier.metrics.MeasurementVisitor
    com.jeantessier.metrics.Metrics
    com.jeantessier.metrics.MetricsComparator
    com.jeantessier.metrics.MetricsConfiguration
    com.jeantessier.metrics.MetricsConfigurationHandler
    com.jeantessier.metrics.MetricsConfigurationLoader
    com.jeantessier.metrics.MetricsEvent
    com.jeantessier.metrics.MetricsFactory
    com.jeantessier.metrics.MetricsGatherer
    com.jeantessier.metrics.MetricsListener
    com.jeantessier.metrics.NameListMeasurement
    com.jeantessier.metrics.NbSubMetricsMeasurement
    com.jeantessier.metrics.NullMeasurement
    com.jeantessier.metrics.Printer
    com.jeantessier.metrics.RatioMeasurement
    com.jeantessier.metrics.StatisticalMeasurement
    com.jeantessier.metrics.SumMeasurement
    com.jeantessier.metrics.TextPrinter
    com.jeantessier.metrics.XMLPrinter
     
    classes\com\jeantessier\commandline:
    com.jeantessier.commandline.AnyParameterStrategy
    com.jeantessier.commandline.AtLeastParameterStrategy
    com.jeantessier.commandline.AtMostParameterStrategy
    com.jeantessier.commandline.CommandLine
    com.jeantessier.commandline.CommandLineException
    com.jeantessier.commandline.CommandLineSwitch
    com.jeantessier.commandline.CommandLineSwitchBase
    com.jeantessier.commandline.CommandLineUsage
    com.jeantessier.commandline.CountingParameterStrategy
    com.jeantessier.commandline.ExactlyParameterStrategy
    com.jeantessier.commandline.MultipleValuesSwitch
    com.jeantessier.commandline.NullParameterStrategy
    com.jeantessier.commandline.OptionalValueSwitch
    com.jeantessier.commandline.ParameterStrategy
    com.jeantessier.commandline.SingleValueSwitch
    com.jeantessier.commandline.ToggleSwitch
    com.jeantessier.commandline.Visitable
    com.jeantessier.commandline.Visitor

Class

com.jeantessier.dependencyfinder.cli.ClassList


ClassMetrics

Computes numbers from a JAR file, such as number of packages, classes and interfaces, average number of methods per class, number of static, synchronized, or abstract methods, etc.

Synopsis

    ClassMetrics
        [-echo]
        [-help]
        [-instruction-counts]
        [-list]
        [-out filename]
        [-time]
        [-verbose [filename]]
        [-version]
        [filename ...]

Description

This is a simple tally of how many classses, interfaces, methods, publics, statics, finals, etc. there are in a given codebase. These tallies are not as powerful as the metrics of OOMetrics, but they can give you a rough idea of the size and complexity of a piece of software.

Switches

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-list

Lists the programming elements under each measurement.

Mandatory:no
Multiples:no
Default value:none

-instruction-count

Shows the number of times each instruction in the Java virtual machine instruction set is used in the codebase.

Mandatory:no
Multiples:no
Default value:none

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

Parameters

File names for JAR files, Zip files, and .class files for the tool to read. You can also give directory names, the tool will search them for JAR files, Zip files, and .class files.

Mandatory:no
Multiples:yes
Default value:".", the current directory

Output

The output format is self-explanatory.

Examples

    ClassMetrics DependencyFinder.jar
    176 class(es)
    23 interface(s)
     
    2099 method(s) (average 10.547738693467336 per class/interface)
    765 field(s) (average 3.8442211055276383 per class/interface)
     
    38 synthetic element(s)
        0 class(es)
        20 fields(s)
        18 method(s)
    0 deprecated element(s)
        0 class(es)
        0 fields(s)
        0 method(s)
    2039 public element(s)
        193 class(es)
        148 fields(s)
        1695 method(s)
        3 inner class(es)
    192 protected element(s)
        1 fields(s)
        191 method(s)
        0 inner class(es)
    716 private element(s)
        586 fields(s)
        130 method(s)
        0 inner class(es)
    116 package element(s)
        3 class(es)
        30 fields(s)
        83 method(s)
        0 inner class(es)
    200 abstract element(s)
        42 class(es)
        155 method(s)
        3 inner class(es)
    390 static element(s)
        245 fields(s)
        142 method(s)
        3 inner class(es)
    221 final element(s)
        2 class(es)
        216 fields(s)
        3 method(s)
        0 inner class(es)
    2 synchronized method(s)
    0 native method(s)
    0 volatile field(s)
    0 transient field(s)
    0 custom attribute(s)

Class

com.jeantessier.dependencyfinder.cli.ClassMetrics


ClassReader

Takes a compiled Java .class file and writes out its structure.

Synopsis

    ClassReader
        [-dtd-prefix uri]
        [-echo]
        [-encoding name]
        [-help]
        [-indent-text text]
        [-out filename]
        [-time]
        [-verbose [filename]]
        [-version]
        [-xml]
        param ...

Description

Takes a compiled Java .class file and writes out its structure. In textual output mode, its output resembles the output of javap. In XML output mode, its output maps the structure, as defined in the Java Virtual Machine Specification.

Switches

-dtd-prefix uri

The prefix of the DTD URL for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:http://depfind.sourceforge.net/dtd

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-encoding name

The encoding used for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:utf-8

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-indent-text text

Uses text for each indentation level in XML output.

Mandatory:no
Multiples:no
Default value:Four spaces, "    "

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

-xml

Writes the .class file information as an XML document with the classfile DTD.

Mandatory:no
Multiples:no
Default value:none

Parameters

File names for JAR files, Zip files, and .class files for the tool to read. You can also give directory names, the tool will search them for JAR files, Zip files, and .class files.

Mandatory:yes
Multiples:yes
Default value:none

Output

By default, prints the content of the constant pool, followed by a summary of the class that looks similar to the output of javap.

With -xml, it converts the entire Classfile structure into an XML document that follows the classfile DTD.

Examples

Here is a sample textual output:

    ClassReader classes\test.class
    1: Method java/lang/Object.<init>()V
    2: Class java/lang/Object
    3: Method java/util/Collections.singleton(Ljava/lang/Object;)Ljava/util/Set;
    4: Class java/lang/NullPointerException
    5: Field Ljava/io/PrintStream; java/lang/System.out
    6: Method java/io/PrintStream.println(Ljava/lang/Object;)V
    7: Class test
    8: "<init>"
    9: "()V"
    10: "Code"
    11: "LineNumberTable"
    12: "LocalVariableTable"
    13: "this"
    14: "Ltest;"
    15: "main"
    16: "([Ljava/lang/String;)V"
    17: "args"
    18: "[Ljava/lang/String;"
    19: "c"
    20: "Ljava/util/Collection;"
    21: "ex"
    22: "Ljava/lang/NullPointerException;"
    23: "SourceFile"
    24: "test.java"
    25: Name and Type <init> ()V
    26: "java/lang/Object"
    27: Class java/util/Collections
    28: Name and Type singleton (Ljava/lang/Object;)Ljava/util/Set;
    29: "java/lang/NullPointerException"
    30: Class java/lang/System
    31: Name and Type out Ljava/io/PrintStream;
    32: Class java/io/PrintStream
    33: Name and Type println (Ljava/lang/Object;)V
    34: "test"
    35: "java/util/Collections"
    36: "singleton"
    37: "(Ljava/lang/Object;)Ljava/util/Set;"
    38: "java/lang/System"
    39: "out"
    40: "Ljava/io/PrintStream;"
    41: "java/io/PrintStream"
    42: "println"
    43: "(Ljava/lang/Object;)V"
    public class test extends java.lang.Object {
        public static void main(java.lang.String[]);
        public test();
    }

And here is the XML document, built from a .class file.

    ClassReader -xml classes\test.class
    <?xml version="1.0" encoding="UTF-8" ?>
     
    <!DOCTYPE classfile SYSTEM "http://depfind.sourceforge.net/dtd/classfile.dtd">
     
    <classfile magic-number="-889275714" minor-version="0" major-version="46" access-number="00000000 00100001">
        <constant-pool>
            <method-ref-info id="1"><class>java.lang.Object</class><name><init></name><type>()V</type></method-ref-info>
            <class id="2">java.lang.Object</class>
            <method-ref-info id="3"><class>java.util.Collections</class><name>singleton</name><type>(Ljava/lang/Object;)Ljava/util/Set;</type></method-ref-info>
            <class id="4">java.lang.NullPointerException</class>
            <field-ref-info id="5"><class>java.lang.System</class><type>Ljava/io/PrintStream;</type><name>out</name></field-ref-info>
            <method-ref-info id="6"><class>java.io.PrintStream</class><name>println</name><type>(Ljava/lang/Object;)V</type></method-ref-info>
            <class id="7">test</class>
            <utf8-info id="8"><init></utf8-info>
            <utf8-info id="9">()V</utf8-info>
            <utf8-info id="10">Code</utf8-info>
            <utf8-info id="11">LineNumberTable</utf8-info>
            <utf8-info id="12">LocalVariableTable</utf8-info>
            <utf8-info id="13">this</utf8-info>
            <utf8-info id="14">Ltest;</utf8-info>
            <utf8-info id="15">main</utf8-info>
            <utf8-info id="16">([Ljava/lang/String;)V</utf8-info>
            <utf8-info id="17">args</utf8-info>
            <utf8-info id="18">[Ljava/lang/String;</utf8-info>
            <utf8-info id="19">c</utf8-info>
            <utf8-info id="20">Ljava/util/Collection;</utf8-info>
            <utf8-info id="21">ex</utf8-info>
            <utf8-info id="22">Ljava/lang/NullPointerException;</utf8-info>
            <utf8-info id="23">SourceFile</utf8-info>
            <utf8-info id="24">test.java</utf8-info>
            <name-and-type-info id="25"><name><init></name><type>()V</type></name-and-type-info>
            <utf8-info id="26">java/lang/Object</utf8-info>
            <class id="27">java.util.Collections</class>
            <name-and-type-info id="28"><name>singleton</name><type>(Ljava/lang/Object;)Ljava/util/Set;</type></name-and-type-info>
            <utf8-info id="29">java/lang/NullPointerException</utf8-info>
            <class id="30">java.lang.System</class>
            <name-and-type-info id="31"><name>out</name><type>Ljava/io/PrintStream;</type></name-and-type-info>
            <class id="32">java.io.PrintStream</class>
            <name-and-type-info id="33"><name>println</name><type>(Ljava/lang/Object;)V</type></name-and-type-info>
            <utf8-info id="34">test</utf8-info>
            <utf8-info id="35">java/util/Collections</utf8-info>
            <utf8-info id="36">singleton</utf8-info>
            <utf8-info id="37">(Ljava/lang/Object;)Ljava/util/Set;</utf8-info>
            <utf8-info id="38">java/lang/System</utf8-info>
            <utf8-info id="39">out</utf8-info>
            <utf8-info id="40">Ljava/io/PrintStream;</utf8-info>
            <utf8-info id="41">java/io/PrintStream</utf8-info>
            <utf8-info id="42">println</utf8-info>
            <utf8-info id="43">(Ljava/lang/Object;)V</utf8-info>
        </constant-pool>
        <public/>
        <super/>
        <this-class>test</this-class>
        <superclass>java.lang.Object</superclass>
        <methods>
            <method-info access-flag="00000000 00001001">
                <public/>
                <static/>
                <name>main</name>
                <return-type>void</return-type>
                <signature>main(java.lang.String[])</signature>
                <attributes>
                    <code-attribute>
                        <length>26</length>
                        <instructions>
                            <instruction pc="0" length="3">new java.lang.Object</instruction>
                            <instruction pc="3" length="1">dup</instruction>
                            <instruction pc="4" length="3">invokespecial java.lang.Object.Object()</instruction>
                            <instruction pc="7" length="3">invokestatic java.util.Set java.util.Collections.singleton(java.lang.Object)</instruction>
                            <instruction pc="10" length="1">astore_1</instruction>
                            <instruction pc="11" length="3">goto</instruction>
                            <instruction pc="14" length="1">astore_1</instruction>
                            <instruction pc="15" length="3">getstatic java.io.PrintStream java.lang.System.out</instruction>
                            <instruction pc="18" length="1">aload_1</instruction>
                            <instruction pc="19" length="3">invokevirtual void java.io.PrintStream.println(java.lang.Object)</instruction>
                            <instruction pc="22" length="3">goto</instruction>
                            <instruction pc="25" length="1">return</instruction>
                        </instructions>
                        <exception-handlers>
                            <exception-handler><start-pc>0</start-pc><end-pc>11</end-pc><handler-pc>14</handler-pc><catch-type>java.lang.NullPointerException</catch-type></exception-handler>
                        </exception-handlers>
                        <attributes>
                            <line-number-table-attribute>
                                <line-number><start-pc>0</start-pc><line>38</line></line-number>
                                <line-number><start-pc>11</start-pc><line>39</line></line-number>
                                <line-number><start-pc>14</start-pc><line>40</line></line-number>
                                <line-number><start-pc>22</start-pc><line>41</line></line-number>
                                <line-number><start-pc>25</start-pc><line>42</line></line-number>
                            </line-number-table-attribute>
                            <local-variable-table-attribute>
                                <local-variable pc="0" length="26"><name>args</name><type>java.lang.String[]</type></local-variable>
                                <local-variable pc="11" length="0"><name>c</name><type>java.util.Collection</type></local-variable>
                                <local-variable pc="15" length="10"><name>ex</name><type>java.lang.NullPointerException</type></local-variable>
                            </local-variable-table-attribute>
                        </attributes>
                    </code-attribute>
                </attributes>
            </method-info>
            <method-info access-flag="00000000 00000001">
                <public/>
                <name><init></name>
                <signature>test()</signature>
                <attributes>
                    <code-attribute>
                        <length>5</length>
                        <instructions>
                            <instruction pc="0" length="1">aload_0</instruction>
                            <instruction pc="1" length="3">invokespecial java.lang.Object.Object()</instruction>
                            <instruction pc="4" length="1">return</instruction>
                        </instructions>
                        <attributes>
                            <line-number-table-attribute>
                                <line-number><start-pc>0</start-pc><line>35</line></line-number>
                            </line-number-table-attribute>
                            <local-variable-table-attribute>
                                <local-variable pc="0" length="5"><name>this</name><type>test</type></local-variable>
                            </local-variable-table-attribute>
                        </attributes>
                    </code-attribute>
                </attributes>
            </method-info>
        </methods>
        <attributes>
            <source-file-attribute>test.java</source-file-attribute>
        </attributes>
    </classfile>

Class

com.jeantessier.dependencyfinder.cli.ClassReader


ClosureToText

Lists the programming elements in a closure.

Synopsis

    ClosureToText
        -in input_file.xml
        [-out output_file.txt]

Description

Lists the packages, classes, and features that make up the dependency graph representing a closure. You generate these graphs with DependencyClosure.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.txt

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the closure in dg.closure.xml to a textual list of elements:

    ClosureToText -in dg.closure.xml

To save the output to a text file:

    ClosureToText -in dg.closure.xml -out dg.closure.txt

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/ClosureToText.xsl


DependablesToHTML

Show nodes with only their inbound dependencies as HTML, ignoring nodes that have no inbound dependencies.

Synopsis

    DependablesToHTML
        -in input_file.xml
        [-out output_file.html]

Description

Translates only inbound dependencies to HTML. Lists only non-empty nodes, weaved with HTML cross-references between all the elements for easy navigation.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.html

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to a hyperlinked HTML file with only inbound dependencies:

    DependablesToHTML -in dg.xml -out dependencies.html

An element with many inbound dependencies is said to be dependable, meaning that many other elements rely on it being stable.

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DependablesToHTML.xsl


DependablesToText

Show nodes with only their inbound dependencies as text, ignoring nodes that have no inbound dependencies.

Synopsis

    DependablesToText
        -in input_file.xml
        [-out output_file.txt]

Description

Translates only inbound dependencies to text. Lists only non-empty nodes.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.txt

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to plain text with only inbound dependencies:

    DependablesToText -in dg.xml

To convert the dependency graph in dg.xml to a plain text file with only inbound dependencies:

    DependablesToText -in dg.xml -out dependencies.txt

An element with many inbound dependencies is said to be dependable, meaning that many other elements rely on it being stable.

Here is another example that uses the following dependency graph:

    Empty
     
    Bidirectional1 <---> Bidirectional2
     
    Outbound ----> Middle ----> Inbound
       |                           ^
       |                           |
       \---------------------------/

Running this tool on that graph yields this output:

    DependablesToText -in sample.xml
     
        Middle
            <-- Outbound
        Inbound
            <-- Outbound
            <-- Middle
        Bidirectional1
            <-- Bidirectional2
        Bidirectional2
            <-- Bidirectional1

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DependablesToText.xsl


DependencyClosure

Computes transitive closure in a dependency graph from a given starting point to either a specified end point or depth.

Synopsis

    DependencyClosure
        [-class-start-excludes value]*
        [-class-start-includes value]*
        [-class-stop-excludes value]*
        [-class-stop-includes value]*
        [-dtd-prefix uri]
        [-echo]
        [-encoding name]
        [-feature-start-excludes value]*
        [-feature-start-includes value]*
        [-feature-stop-excludes value]*
        [-feature-stop-includes value]*
        [-help]
        [-indent-text text]
        [-maximum-inbound-depth [value]]
        [-maximum-outbound-depth [value]]
        [-out filename]
        [-package-start-excludes value]*
        [-package-start-includes value]*
        [-package-stop-excludes value]*
        [-package-stop-includes value]*
        [-start-excludes value]*
        [-start-excludes-list filename]*
        [-start-includes value]*
        [-start-includes-list filename]*
        [-stop-excludes value]*
        [-stop-excludes-list filename]*
        [-stop-includes value]*
        [-stop-includes-list filename]*
        [-time]
        [-validate]
        [-verbose [filename]]
        [-version]
        [-xml]
        [filename ...]

Description

This tool takes a dependency graph generated by DependencyExtractor and follows a trail of dependencies to construct a subgraph of all dependencies related to a starting point. The result is a new dependency graph which is a subgraph of the original one. You can use the various XXXToText and XXXToHTML scripts to render the graph as text or HTML for human reading.

You can limit the number of hops downstream, along outbound dependencies, with -maximum-outbound-depth. You can limit the number of hops upstream, along inbound dependencies, with -maximum-inbound-depth. By default, the tool will go as far as possible along both inbound and outbound dependencies without visiting any element twice.

See also:

Switches

-class-start-excludes value

After a class matches one of the -start-includes switches, its name must also NOT match the regular expression in value for it to be included in the query's starting point.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-class-start-includes value

The name of a class must match the regular expression in value for it to be included in the query's starting point.

If there are multiples of this switch, the name must at least one of them.

The class can still be excluded if it matches one of the -start-excludes switches.

Mandatory:no
Multiples:yes
Default value:none

-class-stop-excludes value

After a class matches one of the -stop-includes switches, its name must also NOT match the regular expression in value for it to be included in the query's end point.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-class-stop-includes value

The name of a class must match the regular expression in value for it to be included in the query's end point.

If there are multiples of this switch, the name must at least one of them.

The class can still be excluded if it matches one of the -stop-excludes switches.

Mandatory:no
Multiples:yes
Default value:none

-dtd-prefix uri

The prefix of the DTD URL for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:http://depfind.sourceforge.net/dtd

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-encoding name

The encoding used for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:utf-8

-feature-start-excludes value

After a feature matches one of the -start-includes switches, its name must also NOT match the regular expression in value for it to be included in the query's starting point.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-feature-start-includes value

The name of a feature must match the regular expression in value for it to be included in the query's starting point.

If there are multiples of this switch, the name must at least one of them.

The feature can still be excluded if it matches one of the -start-excludes switches.

Mandatory:no
Multiples:yes
Default value:none

-feature-stop-excludes value

After a feature matches one of the -stop-includes switches, its name must also NOT match the regular expression in value for it to be included in the query's end point.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-feature-stop-includes value

The name of a feature must match the regular expression in value for it to be included in the query's end point.

If there are multiples of this switch, the name must at least one of them.

The feature can still be excluded if it matches one of the -stop-excludes switches.

Mandatory:no
Multiples:yes
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-indent-text text

Uses text for each indentation level in textual and XML output.

Mandatory:no
Multiples:no
Default value:Four spaces, "    "

-maximum-inbound-depth [value]

Maximum distance to travel upstream by following inbound dependencies. If value is zero (0), don't follow any inbound dependencies. If value is omitted, or if it is not a number, than the traversal is unbounded. If the switch is omitted, the traversal will be unbounded.

Mandatory:no
Multiples:no
Default value:"" (unbounded)

-maximum-outbound-depth [value]

Maximum distance to travel downstream by following outbound dependencies. If value is zero (0), don't follow any outbound dependencies. If value is omitted, or if it is not a number, than the traversal is unbounded. If the switch is omitted, the traversal will be unbounded.

Mandatory:no
Multiples:no
Default value:"" (unbounded)

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-package-start-excludes value

After a package matches one of the -start-includes switches, its name must also NOT match the regular expression in value for it to be included in the query's starting point.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-package-start-includes value

The name of a package must match the regular expression in value for it to be included in the query's starting point.

If there are multiples of this switch, the name must at least one of them.

The package can still be excluded if it matches one of the -start-excludes switches.

Mandatory:no
Multiples:yes
Default value:none

-package-stop-excludes value

After a package matches one of the -stop-includes switches, its name must also NOT match the regular expression in value for it to be included in the query's end point.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-package-stop-includes value

The name of a package must match the regular expression in value for it to be included in the query's end point.

If there are multiples of this switch, the name must at least one of them.

The package can still be excluded if it matches one of the -stop-excludes switches.

Mandatory:no
Multiples:yes
Default value:none

-start-excludes value

After a package, class, or feature matches one of the -start-includes switches, its name must also NOT match the regular expression in value for it to be included in the query's starting point.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-start-excludes-list filename

The name of a package, class, or feature must NOT match any of the entries in filename for it to be included in the query's starting point.

If there are multiples of this switch, the name must not be in any of them.

Mandatory:no
Multiples:yes
Default value:none

-start-includes value

The name of a package, class, or feature must match the regular expression in value for it to be included in the query's starting point.

If there are multiples of this switch, the name must at least one of them.

The package, class, or feature can still be excluded if it matches one of the -start-excludes switches.

Mandatory:no
Multiples:yes
Default value://

-start-includes-list filename

The name of a package, class, or feature must match an entry in filename for it to be included in the query's starting point.

If there are multiples of this switch, the name must be in at least one of them.

The package, class, or feature can still be excluded if it matches one of the -start-excludes switches, including if it is in a file listed using -start-excludes-list.

Mandatory:no
Multiples:yes
Default value://

-stop-excludes value

After a package, class, or feature matches one of the -stop-includes switches, its name must also NOT match the regular expression in value for it to be included in the query's end point.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-stop-excludes-list filename

After a package, class, or feature matches one of the -stop-includes switches, its name must also NOT match any of the entries in filename for it to be included in the query's end point.

If there are multiples of this switch, the name must not be in any of them.

Mandatory:no
Multiples:yes
Default value:none

-stop-includes value

The name of a package, class, or feature must match the regular expression in value for it to be included in the query's end point.

If there are multiples of this switch, the name must match at least one of them.

The package, class, or feature can still be excluded if it matches one of the -stop-excludes switches.

Mandatory:no
Multiples:yes
Default value:none

-stop-includes-list filename

The name of a package, class, or feature must match an entry in filename for it to be included in the query's end point.

If there are multiples of this switch, the name must be in at least one of the files.

The package, class, or feature can still be excluded if it matches one of the -stop-excludes switches, including if it is in a file listed using -stop-excludes-list.

Mandatory:no
Multiples:yes
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-validate

Validate the input XML against its DTD.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

-xml

Writes the dependency graph as an XML document with the dependencies DTD.

Mandatory:no
Multiples:no
Default value:none

Parameters

Filenames of the XML documents containing the dependency graphs. The tool merges the graphs together into a single dependency graph.

If you don't specify any filenames, it reads the dependency graph straight from standard input.

Mandatory:no
Multiples:yes
Default value:standard input

Output

The normal output is the resulting dependency graph, rendered as text.

With -xml, it converts the resulting dependency graph into an XML document that follows the dependencies DTD.

Examples

Here is an example that uses the following dependency graph:

    Empty
     
    Bidirectional1 <---> Bidirectional2
     
    Outbound ----> Middle ----> Inbound
       |                           ^
       |                           |
       \---------------------------/

Running this tool on that graph yields this output:

    DependencyClosure -start-includes /Outbound/ sample.xml
     
        Inbound
            <-- Middle
            <-- Outbound
        Middle
            --> Inbound
            <-- Outbound
        Outbound
            --> Inbound
            --> Middle

It followed all dependencies leading out of Outbound.

Class

com.jeantessier.dependencyfinder.cli.DependencyClosure


DependencyCycles

Looks for cycles in a dependency graph starting from a given starting point.

Synopsis

    DependencyCycles
        [-class-start-excludes value]*
        [-class-start-includes value]*
        [-dtd-prefix uri]
        [-echo]
        [-encoding name]
        [-feature-start-excludes value]*
        [-feature-start-includes value]*
        [-help]
        [-indent-text text]
        [-maximum-cycle-length value]
        [-out filename]
        [-package-start-excludes value]*
        [-package-start-includes value]*
        [-start-excludes value]*
        [-start-excludes-list filename]*
        [-start-includes value]*
        [-start-includes-list filename]*
        [-time]
        [-validate]
        [-verbose [filename]]
        [-version]
        [-xml]
        [filename ...]

Description

This tool takes a dependency graph generated by DependencyExtractor and follows a trail of dependencies to look for cycles. The result is a list of cycles that it found in the graph. Each cycle lists the dependencies that make it in their proper order.

This tool can read multiple graphs. It will merge them together before it starts looking for cycles.

You can limit the number of dependencies on any cycles with -maximum-cycle-length. By default, the tool will go as far as possible looking for cycles.

See also:

Switches

-class-start-excludes value

The name of a class must NOT match the regular expression in value for it to be included in the starting point.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-class-start-includes value

The name of a class must match the regular expression in value for it to be included in the starting point.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-dtd-prefix uri

The prefix of the DTD URL for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:http://depfind.sourceforge.net/dtd

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-encoding name

The encoding used for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:utf-8

-feature-start-excludes value

The name of a feature must NOT match the regular expression in value for it to be included in the starting point.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-feature-start-includes value

The name of a feature must match the regular expression in value for it to be included in the starting point.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-indent-text text

Uses text for each indentation level in textual and XML output.

Mandatory:no
Multiples:no
Default value:Four spaces, "    "

-maximum-cycle-length value

Only looks for cycles at most value long. If the graph is big, the tool might spend a lot of time following very long chains of dependencies, looking for cycles. Use this switch to restrict it to something manageable.

Mandatory:no
Multiples:no
Default value:none

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-package-start-excludes value

The name of a package must NOT match the regular expression in value for it to be included in the starting point.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-package-start-includes value

The name of a package must match the regular expression in value for it to be included in the starting point.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-start-excludes value

The name of a package, class, or feature must NOT match the regular expression in value for it to be included in the starting point.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-start-excludes-list filename

The name of a package, class, or feature must NOT match any of the entries in filename for it to be included in the starting point.

If there are multiples of this switch, the name must not be in any of them.

Mandatory:no
Multiples:yes
Default value:none

-start-includes value

The name of a package, class, or feature must match the regular expression in value for it to be included in the starting point.

If there are multiples of this switch, the name must match at least one of them.

Mandatory:no
Multiples:yes
Default value://

-start-includes-list filename

The name of a package, class, or feature must match an entry in filename for it to be included in the starting point.

If there are multiples of this switch, the name must be in at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-validate

Validate the input XML against its DTD.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

-xml

Writes the cycles as an XML document with the cycles DTD.

Mandatory:no
Multiples:no
Default value:none

Parameters

Filenames of the XML documents containing the dependency graphs. The tool merges the graphs together into a single dependency graph.

If you don't specify any filenames, it reads the dependency graph straight from standard input.

Mandatory:no
Multiples:yes
Default value:standard input

Output

The normal output is the resulting dependency cycles, rendered as text.

With -xml, it converts the cycles into an XML document that follows the cycles DTD.

Examples

Here is an example that uses the following dependency graph:

    Empty
     
    Bidirectional1 <---> Bidirectional2
     
    Node1 ----> Node2 ----> Node3 ----> Node4
      ^                                   |
      |                                   |
      \-----------------------------------/

Running this tool on that graph yields this output:

    DependencyCycles sample.xml
    Bidirectional1
        --> Bidirectional2
            --> Bidirectional1
    Node1
        --> Node2
            --> Node3
                --> Node4
                    --> Node1

It tried each node in turn, looking for paths that made cycles.

Class

com.jeantessier.dependencyfinder.cli.DependencyCycles


DependencyExtractor

Extracts dependencies from compiled classes.

Synopsis

    DependencyExtractor
        [-class-filter
        [-class-filter-excludes value]*
        [-class-filter-includes value]*
        [-dtd-prefix uri]
        [-echo]
        [-encoding name]
        [-feature-filter]
        [-feature-filter-excludes value]*
        [-feature-filter-includes value]*
        [-filter-excludes value]*
        [-filter-excludes-list filename]*
        [-filter-includes value]*
        [-filter-includes-list filename]*
        [-help]
        [-indent-text text]
        [-maximize]
        [-minimize]
        [-out filename]
        [-package-filter]
        [-package-filter-excludes value]*
        [-package-filter-includes value]*
        [-time]
        [-verbose [filename]]
        [-version]
        [-xml]
        [filename ...]

Description

Takes a JAR and computes dependencies between packages, classes, and features (methods and attributes). The result is an XML document containing all the dependencies.

See also:

Switches

-class-filter

Show dependencies to and/or from classes.

Mandatory:no
Multiples:no
Default value:none

-class-filter-excludes value

If a class is at the other end of the dependency, its name must NOT match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-class-filter-includes value

If a class is at the other end of the dependency, its name must match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-dtd-prefix uri

The prefix of the DTD URL for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:http://depfind.sourceforge.net/dtd

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-encoding name

The encoding used for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:utf-8

-feature-filter

Show dependencies to and/or from features.

Mandatory:no
Multiples:no
Default value:none

-feature-filter-excludes value

If a feature is at the other end of the dependency, its name must NOT match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-feature-filter-includes value

If a feature is at the other end of the dependency, its name must match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-filter-excludes value

The name of a package, class, or feature at the other end of the dependency must NOT match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-filter-excludes-list filename

The name of a package, class, or feature at the other end of the dependency must NOT match any of the entries in filename for the dependency to be included in the results.

If there are multiples of this switch, the name must not be in any of them.

Mandatory:no
Multiples:yes
Default value:none

-filter-includes value

The name of a package, class, or feature at the other end of the dependency must match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must match at least one of them.

Mandatory:no
Multiples:yes
Default value://

-filter-includes-list filename

The name of a package, class, or feature at the other end of the dependency must match match an entry in filename for the dependency to be included in the results.

If there are multiples of this switch, the name must be in at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-indent-text text

Uses text for each indentation level in textual and XML output.

Mandatory:no
Multiples:no
Default value:Four spaces, "    "

-maximize

Maximizes the dependency graph before outputing it.

Mandatory:no
Multiples:no
Default value:none

-minimize

Minimizes the dependency graph before outputing it.

Mandatory:no
Multiples:no
Default value:none

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-package-filter

Show dependencies to and/or from packages.

Mandatory:no
Multiples:no
Default value:none

-package-filter-excludes value

If a package is at the other end of the dependency, its name must NOT match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-package-filter-includes value

If a package is at the other end of the dependency, its name must match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

-xml

Writes the dependency graph as an XML document with the dependencies DTD.

Mandatory:no
Multiples:no
Default value:none

Parameters

File names for JAR files, Zip files, and .class files for the tool to read. You can also give directory names, the tool will search them for JAR files, Zip files, and .class files.

Mandatory:no
Multiples:yes
Default value:".", the current directory

Output

The normal output is the dependency graph, rendered as text.

With -xml, it converts the entire dependency graph into an XML document that follows the dependencies DTD.

Examples

To scan the current directory and its subdirectories for .class files to analyze and save the resulting dependency graph to dg.xml:

    DependencyExtractor -xml -out dg.xml 

To scan DependencyFinder.jar and rt.jar for .class files to analyze and save the resulting dependency graph to dg.xml:

    DependencyExtractor -xml -out dg.xml DependencyFinder.jar rt.jar

To scan DependencyFinder.jar and rt.jar for .class files to analyze and save the resulting dependency graph to dg.xml without any dependencies on java.*:

    DependencyExtractor -xml -out dg.xml DependencyFinder.jar rt.jar -filter-excludes /^java\./

To scan DependencyFinder.jar and rt.jar for .class files to analyze and save the resulting dependency graph to dg.xml, after having minimized it:

    DependencyExtractor -xml -minimize -out dg.xml DependencyFinder.jar rt.jar

Class

com.jeantessier.dependencyfinder.cli.DependencyExtractor


DependencyFinder

Swing application for dependency analysis.

Synopsis

    DependencyFinder
        [-dtd-prefix uri]
        [-encoding name]
        [-help]
        [-indent-text text]
        [-maximize]
        [-minimize]

Description

A Swing-based application that combines the tools for dependency analysis. It keeps the dependency graph in memory, saving on loading time between queries.

It combines the functionalities of the following tools:

Switches

-encoding name

The encoding used for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:utf-8

-dtd-prefix uri

The prefix of the DTD URL for the saving dependency graphs to XML documents.

Mandatory:no
Multiples:no
Default value:http://depfind.sourceforge.net/dtd

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-indent-text text

Uses text for each indentation level when saving graphs in XML documents.

Mandatory:no
Multiples:no
Default value:Four spaces, "    "

-maximize

Maximize the dependency graph after extraction.

Mandatory:no
Multiples:no
Default value:none

-minimize

Minimize the dependency graph after extraction.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

none

Examples

See the user manual.

Class

com.jeantessier.dependencyfinder.gui.DependencyFinder


DependencyGraphToFullyQualifiedNames

Lists symbols from a dependency graph.

Synopsis

    DependencyGraphToFullyQualifiedNames
        -in input_file.xml
        [-out output_file.txt]

Description

Looks at the graph from DependencyExtractor, DependencyReporter, or DependencyClosure and lists package, class, and feature names that are in it.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.txt

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to plain text with only inbound dependencies:

    DependencyGraphToFullyQualifiedNames -in dg.xml

To convert the dependency graph in dg.xml to a plain text file with only inbound dependencies:

    DependencyGraphToFullyQualifiedNames -in dg.xml -out dependencies.txt

An element with many inbound dependencies is said to be dependable, meaning that many other elements rely on it being stable.

Here is another example that uses the following dependency graph:

    Empty
     
    Bidirectional1 <---> Bidirectional2
     
    Outbound ----> Middle ----> Inbound
       |                           ^
       |                           |
       \---------------------------/

Running this tool on that graph yields this output:

    DependencyGraphToFullyQualifiedNames -in sample.xml
     
    Outbound
    Middle
    Inbound
    Bidirectional1
    Bidirectional2
    Empty

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DependencyGraphToFullyQualifiedNames.xsl


DependencyGraphToGraphML

Translates the whole graph to GraphML.

Synopsis

    DependencyGraphToGraphML
        -in input_file.xml
        [-out output_file.html]

Description

Translates both outbound and inbound dependencies to basic GraphML.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.html

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to a GraphML file:

    DependencyGraphToGraphML -in dg.xml -out dg.graphml

This GraphML file shows both outbound and inbound dependencies.

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DependencyGraphToGraphML.xsl


DependencyGraphToHTML

Translates the whole graph to HTML.

Synopsis

    DependencyGraphToHTML
        -in input_file.xml
        [-out output_file.html]

Description

Translates both outbound and inbound dependencies to HTML. Lists nodes, weaved with HTML cross-references between all the elements for easy navigation.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.html

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to a hyperlinked HTML file, for ease of use:

    DependencyGraphToHTML -in dg.xml -out dependencies.html

This HTML file shows both outbound and inbound dependencies.

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DependencyGraphToHTML.xsl


DependencyGraphToRDF

Translates the whole graph to RDF.

Synopsis

    DependencyGraphToRDF
        -in input_file.xml
        [-out output_file.html]

Description

Translates both outbound and inbound dependencies to RDF.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.html

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to a hyperlinked HTML file, for ease of use:

    DependencyGraphToHTML -in dg.xml -out dependencies.html

This HTML file shows both outbound and inbound dependencies.

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DependencyGraphToRDF.xsl


DependencyGraphToText

Translates the whole graph to text.

Synopsis

    DependencyGraphToText
        -in input_file.xml
        [-out output_file.txt]

Description

Translates both outbound and inbound dependencies to text.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.txt

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to a plain text:

    DependencyGraphToText -in dg.xml

To convert the dependency graph in dg.xml to a plain text file, for ease of use:

    DependencyGraphToText -in dg.xml -out dependencies.txt

This text file shows both outbound and inbound dependencies.

Here is another example that uses the following dependency graph:

    Empty
     
    Bidirectional1 <---> Bidirectional2
     
    Outbound ----> Middle ----> Inbound
       |                           ^
       |                           |
       \---------------------------/

Running this tool on that graph yields this output:

    DependencyGraphToText -in sample.xml
     
        Outbound
            --> Middle
            --> Inbound
        Middle
            --> Inbound
            <-- Outbound
        Inbound
            <-- Outbound
            <-- Middle
        Bidirectional1
            --> Bidirectional2
            <-- Bidirectional2
        Bidirectional2
            --> Bidirectional1
            <-- Bidirectional1
        Empty

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DependencyGraphToText.xsl


DependencyGraphToUnconfirmedFullyQualifiedNames

Lists unconfirmed symbols from a dependency graph.

Synopsis

    DependencyGraphToUnconfirmedFullyQualifiedNames
        -in input_file.xml
        [-out output_file.txt]

Description

Looks at the graph from DependencyExtractor, DependencyReporter, or DependencyClosure and lists package, class, and feature names that are in it and that are unconfirmed.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.txt

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To list unconfirmed symbols in the dependency graph in dg.xml:

    DependencyGraphToUnconfirmedFullyQualifiedNames -in dg.xml

To list unconfirmed symbols in the dependency graph in dg.xml and save them to a file:

    DependencyGraphToUnconfirmedFullyQualifiedNames -in dg.xml -out dg.unconfirmed.txt

You can get a list of which external packages a JAR file depends upon, and through this which JARs it depends on. For example, given myjar.jar, you can find which packages it needs that are not in it already with:

    DependencyExtractor -xml -out myjar.xml myjar.jar
    p2p -xml -out myjar.p2p.xml myjar.xml
    DependencyGraphToUnconfirmedFullyQualifiedNames -in myjar.p2p.xml -out myjar.unconfirmed.txt

Another example, using classes/test.class:

    DependencyExtractor -xml -out test.df.xml classes/test.class
    p2p -xml -out test.df.p2p.xml test.df.xml
    DependencyGraphToUnconfirmedFullyQualifiedNames -in test.df.p2p.xml
    java.io
    java.lang
    java.util

Another example, using DependencyFinder-1.2.0/lib/DependencyFinder.jar:

    DependencyExtractor -xml -out test.df.xml DependencyFinder-1.2.0/lib/DependencyFinder.jar
    p2p -xml -out test.df.p2p.xml test.df.xml
    DependencyGraphToUnconfirmedFullyQualifiedNames -in test.df.p2p.xml
     
    com.opensymphony.webwork.interceptor
    com.opensymphony.xwork
    com.sun.javadoc
    com.sun.org.apache.xalan.internal.xslt
    java.awt
    java.awt.event
    java.beans
    java.io
    java.lang
    java.lang.reflect
    java.net
    java.text
    java.util
    java.util.jar
    java.util.zip
    javax.servlet
    javax.servlet.http
    javax.swing
    javax.swing.border
    javax.swing.filechooser
    javax.swing.table
    javax.swing.text
    javax.xml.parsers
    org.apache.log4j
    org.apache.oro.text
    org.apache.oro.text.perl
    org.apache.oro.text.regex
    org.apache.tools.ant
    org.apache.tools.ant.types
    org.xml.sax
    org.xml.sax.helpers

From this, I can figure out the other JARs it needs. The packages java.*, javax.swing.*, and those related to XML come with the JDK. I know com.sun.javadoc is in tools.jar, also with the JDK but not part of the normal CLASSPATH. I will need the Log4J and Jakarta-ORO JARs. And I happen to know that the WebWork/XWork classes are only needed in a web app, so maybe I don't need them right now.

If there had been a package that I really didn't know about in the list, I could have used ClassFinder to located it among a group of candidate JARs.

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DependencyGraphToUnconfirmedFullyQualifiedNames.xsl


DependencyGraphToyEd

Translates the whole graph to GraphML for the yEd application.

Synopsis

    DependencyGraphToHTML
        -in input_file.xml
        [-out output_file.html]

Description

Translates both outbound and inbound dependencies to GraphML. It uses a yWorks-specific extension to GraphML to provide shapes and labels to the nodes and dashed arrows for the edges.

You can use yEd to layout the graph. I recommend you open the GraphML file using yEd, then select "Tools >> Fit Node to Label" to make the box for each node cover its label. Then, layout the graph using the "Layout" menu.

See also:

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.html

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to a GraphML suitable for yEd:

    DependencyGraphToyEd -in dg.xml -out dg.graphml

This GraphML file shows both outbound and inbound dependencies.

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DependencyGraphToyEd.xsl


DependencyMetrics

Computes dependency numbers from a dependency graph, such as number of nodes, number of entering vertices, and number of exiting vertices.

Synopsis

    DependencyMetrics
        [-c2c]
        [-c2p]
        [-chart-all]
        [-chart-classes]
        [-chart-classes-per-package]
        [-chart-features]
        [-chart-features-per-class]
        [-chart-inbounds]
        [-chart-inbounds-per-class]
        [-chart-inbounds-per-feature]
        [-chart-inbounds-per-package]
        [-chart-outbounds]
        [-chart-outbounds-per-class]
        [-chart-outbounds-per-feature]
        [-chart-outbounds-per-package]
        [-chart-packages]
        [-class-filter]
        [-class-filter-excludes value]*
        [-class-filter-includes value]*
        [-class-scope]
        [-class-scope-excludes value]*
        [-class-scope-includes value]*
        [-echo]
        [-excludes value]*
        [-f2f]
        [-feature-filter]
        [-feature-filter-excludes value]*
        [-feature-filter-includes value]*
        [-feature-scope]
        [-feature-scope-excludes value]*
        [-feature-scope-includes value]*
        [-filter-excludes value]*
        [-filter-excludes-list filename]*
        [-filter-includes value]*
        [-filter-includes-list filename]*
        [-help]
        [-includes value]*
        [-list]
        [-out filename]
        [-p2p]
        [-package-filter]
        [-package-filter-excludes value]*
        [-package-filter-includes value]*
        [-package-scope]
        [-package-scope-excludes value]*
        [-package-scope-includes value]*
        [-scope-excludes value]*
        [-scope-excludes-list filename]*
        [-scope-includes value]*
        [-scope-includes-list filename]*
        [-time]
        [-validate]
        [-verbose [filename]]
        [-version]
        [filename ...]

Description

This is a simple tally of how many dependencies there are in a graph. It can give you a rough idea of the complexity of a given codebase, but it is not as powerful as the metrics computed by OOMetrics.

Switches

-c2c

Shorthand for the combination of:

Mandatory:no
Multiples:no
Default value:none

-c2p

Shorthand for the combination of:

Mandatory:no
Multiples:no
Default value:none

-chart-all

Shorthand for the combination of:

Mandatory:no
Multiples:no
Default value:none

-chart-classes

Shorthand for the combination of:

Mandatory:no
Multiples:no
Default value:none

-chart-classes-per-package

Shows distribution of classes per package.

Mandatory:no
Multiples:no
Default value:none

-chart-features

Shorthand for the combination of:

Mandatory:no
Multiples:no
Default value:none

-chart-features-per-class

Shows distribution of features per class.

Mandatory:no
Multiples:no
Default value:none

-chart-inbounds

Shorthand for the combination of:

Mandatory:no
Multiples:no
Default value:none

-chart-inbounds-per-class

Shows distribution of explicit inbound dependencies to classes.

Mandatory:no
Multiples:no
Default value:none

-chart-inbounds-per-feature

Shows distribution of explicit inbound dependencies to features.

Mandatory:no
Multiples:no
Default value:none

-chart-inbounds-per-package

Shows distribution of explicit inbound dependencies to packages.

In a raw or minimized graph, this will show zero.

Mandatory:no
Multiples:no
Default value:none

-chart-outbounds

Shorthand for the combination of:

Mandatory:no
Multiples:no
Default value:none

-chart-outbounds-per-class

Shows distribution of explicit outbound dependencies from classes.

Mandatory:no
Multiples:no
Default value:none

-chart-outbounds-per-feature

Shows distribution of explicit outbound dependencies from features.

Mandatory:no
Multiples:no
Default value:none

-chart-outbounds-per-package

Shows distribution of explicit outbound dependencies from packages.

In a raw or minimized graph, this will show zero.

Mandatory:no
Multiples:no
Default value:none

-chart-packages

Shorthand for the combination of:

Mandatory:no
Multiples:no
Default value:none

-class-filter

Show dependencies to and/or from classes.

Mandatory:no
Multiples:no
Default value:none

-class-filter-excludes value

If a class is at the other end of the dependency, its name must NOT match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-class-filter-includes value

If a class is at the other end of the dependency, its name must match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-class-scope

Select classes (with their package) as part of the query's focus.

Mandatory:no
Multiples:no
Default value:none

-class-scope-excludes value

The name of a class must NOT match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-class-scope-includes value

The name of a class must match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-excludes value

Shorthand for the combination of:

Mandatory:no
Multiples:yes
Default value:none

-f2f

Shorthand for the combination of:

Mandatory:no
Multiples:no
Default value:none

-feature-filter

Show dependencies to and/or from features.

Mandatory:no
Multiples:no
Default value:none

-feature-filter-excludes value

If a feature is at the other end of the dependency, its name must NOT match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-feature-filter-includes value

If a feature is at the other end of the dependency, its name must match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-feature-scope

Select features (with their class and package) as part of the query's focus.

Mandatory:no
Multiples:no
Default value:none

-feature-scope-excludes value

The name of a feature must NOT match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-feature-scope-includes value

The name of a feature must match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-filter-excludes value

The name of a package, class, or feature at the other end of the dependency must NOT match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-filter-excludes-list filename

The name of a package, class, or feature at the other end of the dependency must NOT match any of the entries in filename for the dependency to be included in the results.

If there are multiples of this switch, the name must not be in any of them.

Mandatory:no
Multiples:yes
Default value:none

-filter-includes value

The name of a package, class, or feature at the other end of the dependency must match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value://

-filter-includes-list filename

The name of a package, class, or feature at the other end of the dependency must match match an entry in filename for the dependency to be included in the results.

If there are multiples of this switch, the name must be in at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-includes value

Shorthand for the combination of:

Mandatory:no
Multiples:yes
Default value://

-list

Lists the packages, classes, and features analyzed.

Mandatory:no
Multiples:no
Default value:none

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-p2p

Shorthand for the combination of:

Mandatory:no
Multiples:no
Default value:none

-package-filter

Show dependencies to and/or from packages.

Mandatory:no
Multiples:no
Default value:none

-package-filter-excludes value

If a package is at the other end of the dependency, its name must NOT match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-package-filter-includes value

If a package is at the other end of the dependency, its name must match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-package-scope

Select packages as part of the query's focus.

Mandatory:no
Multiples:no
Default value:none

-package-scope-excludes value

The name of a package must NOT match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-package-scope-includes value

The name of a package must match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-scope-excludes value

The name of a package, class, or feature must NOT match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-scope-excludes-list filename

The name of a package, class, or feature must NOT match any of the entries in filename for it to be included in the query's focus.

If there are multiples of this switch, the name must not be in any of them.

Mandatory:no
Multiples:yes
Default value:none

-scope-includes value

The name of a package, class, or feature must match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value://

-scope-includes-list filename

The name of a package, class, or feature must match an entry in filename for it to be included in the query's focus.

If there are multiples of this switch, the name must be in at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-validate

Validate the input XML against its DTD.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

Parameters

Filenames of the XML documents containing the dependency graphs. The tool merges the graphs together into a single dependency graph.

If you don't specify any filenames, it reads the dependency graph straight from standard input.

Mandatory:no
Multiples:yes
Default value:standard input

Output

The output format is self-explanatory.

Examples

Here is a sample output:

    DependencyExtractor -xml -out test.xml classes\test.class
    DependencyMetrics test.xml
    4 package(s)
    8 class(es)
    6 feature(s)
     
    11 outbound link(s)
        0 from package(s) (average 0.0 per package)
        6 from class(es) (average 0.75 per class)
        5 from feature(s) (average 0.8333333333333334 per feature)
    11 inbound link(s)
        0 to package(s) (average 0.0 per package)
        1 to class(es) (average 0.125 per class)
        10 to feature(s) (average 1.6666666666666667 per feature)

And here it is with -list:

    DependencyExtractor -xml -out test.xml classes\test.class
    DependencyMetrics -list test.xml
    4 package(s)
        java.lang
        java.util
        java.io
         
    8 class(es)
        java.lang.String
        java.lang.Object
        java.lang.NullPointerException
        java.lang.System
        java.util.Collections
        java.util.Set
        java.io.PrintStream
        test
    6 feature(s)
        java.lang.Object.Object()
        java.lang.System.out
        java.util.Collections.singleton(java.lang.Object)
        java.io.PrintStream.println(java.lang.Object)
        test.test()
        test.main(java.lang.String[])
     
    11 outbound link(s)
        0 from package(s) (average 0.0 per package)
        6 from class(es) (average 0.75 per class)
        5 from feature(s) (average 0.8333333333333334 per feature)
    11 inbound link(s)
        0 to package(s) (average 0.0 per package)
        1 to class(es) (average 0.125 per class)
        10 to feature(s) (average 1.6666666666666667 per feature)

You can also write them simply as:

    DependencyExtractor -xml classes\test.class | DependencyMetrics

or

    DependencyExtractor -xml classes\test.class | DependencyMetrics -list

Class

com.jeantessier.dependencyfinder.cli.DependencyMetrics


DependencyReporter

Summarizes a dependency graph according to user-specified criteria.

Synopsis

    DependencyReporter
        [-c2c]
        [-c2p]
        [-class-filter
        [-class-filter-excludes value]*
        [-class-filter-includes value]*
        [-class-scope]
        [-class-scope-excludes value]*
        [-class-scope-includes value]*
        [-copy-only]
        [-dtd-prefix uri]
        [-echo]
        [-encoding name]
        [-excludes value]*
        [-f2f]
        [-feature-filter]
        [-feature-filter-excludes value]*
        [-feature-filter-includes value]*
        [-feature-scope]
        [-feature-scope-excludes value]*
        [-feature-scope-includes value]*
        [-filter-excludes value]*
        [-filter-excludes-list filename]*
        [-filter-includes value]*
        [-filter-includes-list filename]*
        [-help]
        [-includes value]*
        [-indent-text text]
        [-maximize]
        [-minimize]
        [-out filename]
        [-p2p]
        [-package-filter]
        [-package-filter-excludes value]*
        [-package-filter-includes value]*
        [-package-scope]
        [-package-scope-excludes value]*
        [-package-scope-includes value]*
        [-scope-excludes value]*
        [-scope-excludes-list filename]*
        [-scope-includes value]*
        [-scope-includes-list filename]*
        [-show-empty-nodes]
        [-show-inbounds]
        [-show-outbounds]
        [-time]
        [-validate]
        [-verbose [filename]]
        [-version]
        [-xml]
        [filename ...]

Description

This tool takes a dependency graph generated by DependencyExtractor and filters it based on selection criteria provided by the user. The result is a new dependency graph which is a subgraph of the original one. You can use the various XXXToText and XXXToHTML scripts to render the graph as text or HTML for human reading.

By default, this tool writes out the same graph that it read in. Without any switches, the output graph is the same as the input graph.

This tool can read multiple graphs and apply the same selection criteria across them to generate an aggregated result. With sufficiently wide criteria, you can use this tool to combine multiple graphs into one.

See also:

Switches

-c2c

Shorthand for the combination of:

See also:

Mandatory:no
Multiples:no
Default value:none

-c2p

Shorthand for the combination of:

See also:

Mandatory:no
Multiples:no
Default value:none

-class-filter

Show dependencies to and/or from classes.

Mandatory:no
Multiples:no
Default value:none

-class-filter-excludes value

If a class is at the other end of the dependency, its name must NOT match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-class-filter-includes value

If a class is at the other end of the dependency, its name must match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-class-scope

Select classes (with their package) as part of the query's focus.

Mandatory:no
Multiples:no
Default value:none

-class-scope-excludes value

The name of a class must NOT match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-class-scope-includes value

The name of a class must match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-copy-only

Limit the report to dependencies that are actually in the source graph. This will prevent the reporter from inferring implicit dependencies when possible.

Mandatory:no
Multiples:no
Default value:none

-dtd-prefix uri

The prefix of the DTD URL for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:http://depfind.sourceforge.net/dtd

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-encoding name

The encoding used for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:utf-8

-excludes value

Shorthand for the combination of:

Mandatory:no
Multiples:yes
Default value:none

-f2f

Shorthand for the combination of:

See also:

Mandatory:no
Multiples:no
Default value:none

-feature-filter

Show dependencies to and/or from features.

Mandatory:no
Multiples:no
Default value:none

-feature-filter-excludes value

If a feature is at the other end of the dependency, its name must NOT match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-feature-filter-includes value

If a feature is at the other end of the dependency, its name must match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-feature-scope

Select features (with their class and package) as part of the query's focus.

Mandatory:no
Multiples:no
Default value:none

-feature-scope-excludes value

The name of a feature must NOT match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-feature-scope-includes value

The name of a feature must match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-filter-excludes value

The name of a package, class, or feature at the other end of the dependency must NOT match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-filter-excludes-list filename

The name of a package, class, or feature at the other end of the dependency must NOT match any of the entries in filename for the dependency to be included in the results.

If there are multiples of this switch, the name must not be in any of them.

Mandatory:no
Multiples:yes
Default value:none

-filter-includes value

The name of a package, class, or feature at the other end of the dependency must match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must match at least one of them.

Mandatory:no
Multiples:yes
Default value://

-filter-includes-list filename

The name of a package, class, or feature at the other end of the dependency must match match an entry in filename for the dependency to be included in the results.

If there are multiples of this switch, the name must be in at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-includes value

Shorthand for the combination of:

Mandatory:no
Multiples:yes
Default value://

-indent-text text

Uses text for each indentation level in textual and XML output.

Mandatory:no
Multiples:no
Default value:Four spaces, "    "

-maximize

Maximize the dependency graph before outputing it.

Mandatory:no
Multiples:no
Default value:none

-minimize

Minimize the dependency graph before outputing it.

Mandatory:no
Multiples:no
Default value:none

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-p2p

Shorthand for the combination of:

See also:

Mandatory:no
Multiples:no
Default value:none

-package-filter

Show dependencies to and/or from packages.

Mandatory:no
Multiples:no
Default value:none

-package-filter-excludes value

If a package is at the other end of the dependency, its name must NOT match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-package-filter-includes value

If a package is at the other end of the dependency, its name must match the regular expression in value for the dependency to be included in the results.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-package-scope

Select packages as part of the query's focus.

Mandatory:no
Multiples:no
Default value:none

-package-scope-excludes value

The name of a package must NOT match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-package-scope-includes value

The name of a package must match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-scope-excludes value

The name of a package, class, or feature must NOT match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-scope-excludes-list filename

The name of a package, class, or feature must NOT match any of the entries in filename for it to be included in the query's focus.

If there are multiples of this switch, the name must not be in any of them.

Mandatory:no
Multiples:yes
Default value:none

-scope-includes value

The name of a package, class, or feature must match the regular expression in value for it to be included in the query's focus.

If there are multiples of this switch, the name must match at least one of them.

Mandatory:no
Multiples:yes
Default value://

-scope-includes-list filename

The name of a package, class, or feature must match an entry in filename for it to be included in the query's focus.

If there are multiples of this switch, the name must be in at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-show-empty-nodes

Lists nodes in the scope, even if they would appear empty because they have no inbound or outbound dependencies.

Mandatory:no
Multiples:no
Default value:none

-show-inbounds

Lists filtered inbound dependencies for scoped nodes.

Mandatory:no
Multiples:no
Default value:none

-show-outbounds

Lists filtered outbound dependencies for scoped nodes.

Mandatory:no
Multiples:no
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-validate

Validate the input XML against its DTD.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

-xml

Writes the dependency graph as an XML document with the dependencies DTD.

Mandatory:no
Multiples:no
Default value:none

Parameters

Filenames of the XML documents containing the dependency graphs. The tool merges the graphs together into a single dependency graph.

If you don't specify any filenames, it reads the dependency graph straight from standard input.

Mandatory:no
Multiples:yes
Default value:standard input

Output

The normal output is the resulting dependency graph, rendered as text.

With -xml, it converts the resulting dependency graph into an XML document that follows the dependencies DTD.

Examples

This command reduces the graph to package-to-package dependencies and shows only packages that have "jeantessier" in the name.

    DependencyReporter -p2p -includes /jeantessier/ df.xml
    com.jeantessier.classreader
        <-- com.jeantessier.dependency
        <-- com.jeantessier.dependencyfinder.cli
        <-- com.jeantessier.dependencyfinder.gui
        <-- com.jeantessier.diff
        <-- com.jeantessier.metrics
    com.jeantessier.commandline
        <-- com.jeantessier.dependencyfinder.cli
        <-- com.jeantessier.dependencyfinder.gui
    com.jeantessier.dependency
        --> com.jeantessier.classreader
        <-- com.jeantessier.dependencyfinder.cli
        <-- com.jeantessier.dependencyfinder.gui
        <-- com.jeantessier.diff
    com.jeantessier.dependencyfinder.cli
        --> com.jeantessier.classreader
        --> com.jeantessier.commandline
        --> com.jeantessier.dependency
        --> com.jeantessier.diff
        --> com.jeantessier.metrics
    com.jeantessier.dependencyfinder.gui
        --> com.jeantessier.classreader
        --> com.jeantessier.commandline
        --> com.jeantessier.dependency
        --> com.jeantessier.metrics
    com.jeantessier.diff
        --> com.jeantessier.classreader
        --> com.jeantessier.dependency
        <-- com.jeantessier.dependencyfinder.cli
    com.jeantessier.metrics
        --> com.jeantessier.classreader
        <-- com.jeantessier.dependencyfinder.cli
        <-- com.jeantessier.dependencyfinder.gui

Class

com.jeantessier.dependencyfinder.cli.DependencyReporter


DependentsToHTML

Show nodes with only their outbound dependencies as HTML, ignoring nodes that have no outbound dependencies.

Synopsis

    DependentsToHTML
        -in input_file.xml
        [-out output_file.html]

Description

Translates only outbound dependencies to HTML. Lists only non-empty nodes, weaved with HTML cross-references between all the elements for easy navigation.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.html

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to a hyperlinked HTML file with only outboud dependencies:

    DependentsToHTML -in dg.xml -out dependencies.html

An element with many outbound dependencies is said to be dependent, meaning that it relies on many other elements being stable.

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DependentsToHTML.xsl


DependentsToText

Show nodes with only their outbound dependencies as text, ignoring nodes that have no outbound dependencies.

Synopsis

    DependentsToText
        -in input_file.xml
        [-out output_file.txt]

Description

Translates only outbound dependencies to text. Lists only non-empty nodes.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.txt

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to plain text with only outboud dependencies:

    DependentsToText -in dg.xml

To convert the dependency graph in dg.xml to a plain text file with only outboud dependencies:

    DependentsToText -in dg.xml -out dependencies.txt

An element with many outbound dependencies is said to be dependent, meaning that it relies on many other elements being stable.

Here is another example that uses the following dependency graph:

    Empty
     
    Bidirectional1 <---> Bidirectional2
     
    Outbound ----> Middle ----> Inbound
       |                           ^
       |                           |
       \---------------------------/

Running this tool on that graph yields this output:

    DependentsToText -in sample.xml
     
        Outbound
            --> Middle
            --> Inbound
        Middle
            --> Inbound
        Bidirectional1
            --> Bidirectional2
        Bidirectional2
            --> Bidirectional1

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DependentsToText.xsl


DiffToFullyQualifiedNames

Lists changed symbols from JarJarDiff reports.

Synopsis

    DiffToFullyQualifiedNames
        -in input_file.xml
        [-out output_file.txt]

Description

Looks at the report from JarJarDiff and lists package, class, interface, field, constructor, and method names that have changed.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the differences DTD, such as the output of JarJarDiff.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.txt

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

    JarJarDiff -old old.jar -new new.jar -out report.xml
    DiffToFullyQualifiedNames -in report.xml -out diff-symbols.txt

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DiffToFullyQualifiedNames.xsl


DiffToHTML

Converts the output of JarJarDiff to HTML.

Synopsis

    DiffToHTML
        -in input_file.xml
        [-out output_file.html]

Description

Converts the output of JarJarDiff to HTML.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the differences DTD, such as the output of JarJarDiff.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.html

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the difference report in report.xml to HTML:

    DiffToHTML -in report.xml

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/DiffToHTML.xsl


HideInboundDependenciesToHTML

Show nodes with only their outbound dependencies as HTML, including nodes that have no outbound dependencies.

Synopsis

    HideInboundDependenciesToHTML
        -in input_file.xml
        [-out output_file.html]

Description

Translates only outbound dependencies to HTML. Lists nodes, weaved with HTML cross-references between all the elements for easy navigation.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.html

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to a hyperlinked HTML file with only outboud dependencies:

    HideInboundDependenciesToHTML -in dg.xml -out dependencies.html

An element with many outbound dependencies is said to be dependent, meaning that it relies on many other elements being stable.

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/HideInboundDependenciesToHTML.xsl


HideInboundDependenciesToText

Show nodes with only their outbound dependencies as text, including nodes that have no outbound dependencies.

Synopsis

    HideInboundDependenciesToText
        -in input_file.xml
        [-out output_file.txt]

Description

Translates only outbound dependencies to text.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.txt

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to plain text with only outboud dependencies:

    HideInboundDependenciesToText -in dg.xml

To convert the dependency graph in dg.xml to a plain text file with only outboud dependencies:

    HideInboundDependenciesToText -in dg.xml -out dependencies.txt

An element with many outbound dependencies is said to be dependent, meaning that it relies on many other elements being stable.

Here is another example that uses the following dependency graph:

    Empty
     
    Bidirectional1 <---> Bidirectional2
     
    Outbound ----> Middle ----> Inbound
       |                           ^
       |                           |
       \---------------------------/

Running this tool on that graph yields this output:

    HideInboundDependenciesToText -in sample.xml
     
        Outbound
            --> Middle
            --> Inbound
        Middle
            --> Inbound
        Inbound
        Bidirectional1
            --> Bidirectional2
        Bidirectional2
            --> Bidirectional1
        Empty

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/HideInboundDependenciesToText.xsl


HideOutboundDependenciesToHTML

Show nodes with only their inbound dependencies as HTML, including nodes that have no inbound dependencies.

Synopsis

    HideOutboundDependenciesToHTML
        -in input_file.xml
        [-out output_file.html]

Description

Translates only inbound dependencies to HTML. Lists nodes, weaved with HTML cross-references between all the elements for easy navigation.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.html

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to a hyperlinked HTML file with only inbound dependencies:

    HideOutboundDependenciesToHTML -in dg.xml -out dependencies.html

An element with many inbound dependencies is said to be dependable, meaning that many other elements rely on it being stable.

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/HideOutboundDependenciesToHTML.xsl


HideOutboundDependenciesToText

Show nodes with only their inbound dependencies as text, including nodes that have no inbound dependencies.

Synopsis

    HideOutboundDependenciesToText
        -in input_file.xml
        [-out output_file.txt]

Description

Translates only inbound dependencies to text.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.txt

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in dg.xml to plain text with only inbound dependencies:

    HideOutboundDependenciesToText -in dg.xml

To convert the dependency graph in dg.xml to a plain text file with only inbound dependencies:

    HideOutboundDependenciesToText -in dg.xml -out dependencies.txt

An element with many inbound dependencies is said to be dependable, meaning that many other elements rely on it being stable.

Here is another example that uses the following dependency graph:

    Empty
     
    Bidirectional1 <---> Bidirectional2
     
    Outbound ----> Middle ----> Inbound
       |                           ^
       |                           |
       \---------------------------/

Running this tool on that graph yields this output:

    HideOutboundDependenciesToText -in sample.xml
     
        Outbound
        Middle
            <-- Outbound
        Inbound
            <-- Outbound
            <-- Middle
        Bidirectional1
            <-- Bidirectional2
        Bidirectional2
            <-- Bidirectional1
        Empty

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/HideOutboundDependenciesToText.xsl


JarJarDiff

Computes API differences between two versions of a codebase.

Synopsis

    JarJarDiff
        [-code]
        [-dtd-prefix uri]
        [-echo]
        [-encoding name]
        [-filter filename]
        [-help]
        [-indent-text text]
        [-level value]
        [-name value]
        [-new filename]+
        [-new-label value]
        [-old filename]+
        [-old-label value]
        [-out filename]
        [-time]
        [-verbose [filename]]
        [-version]

Description

Takes two JAR files and computes the API changes between them. The first JAR file is considered the "old" code and the second JAR file is considered the "new" code. The result is an XML document listing the changes. You can use DiffToHTML to render the report in HTML.

You can use -level incompatible to have an analysis that list only "public" changes that might not be backwards compatible.

Switches

-code

Show differences that only appear in code but did not impact the API, such as bytecode changes or different constant values.

Mandatory:no
Multiples:no
Default value:none

-dtd-prefix uri

The prefix of the DTD URL for the XML output document.

Mandatory:no
Multiples:no
Default value:http://depfind.sourceforge.net/dtd

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-encoding name

The encoding used for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:utf-8

-filter filename

Location of the file with the list of programming elements that the tool should limit itself to. If omitted, the tool reports on all programming elements.

Mandatory:no
Multiples:no
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-indent-text text

Uses text for each indentation level in XML output.

Mandatory:no
Multiples:no
Default value:Four spaces, "    "

-level value

Tells JarJarDiff which strategy to use to determine differences.

There are two special values for the predefined values for the strategies that come with Dependency Finder:

api
Shows all API differences. Same as com.jeantessier.diff.APIDifferenceStrategy.
incompatible
Shows only differences that would be incompatible with the old version. Same as com.jeantessier.diff.IncompatibleDifferenceStrategy.

If value is not one of the special values above, it is treated as the name of a class. JarJarDiff will try to instantiate this class using a default constructor and cast it to DifferenceStrategy. If this fails anywhere along the way, it will fall back on the default value listed below.

Mandatory:no
Multiples:no
Default value:api

-name value

Project name for the report.

Mandatory:no
Multiples:no
Default value:none

-new filename

File names for JAR files, Zip files, and .class files for the tool to read. You can also give directory names, the tool will search them for JAR files, Zip files, and .class files. They make up the new version of the codebase.

Mandatory:yes
Multiples:yes
Default value:none

-new-label value

Version name for the report.

Mandatory:no
Multiples:no
Default value:value of -new

-old filename

File names for JAR files, Zip files, and .class files for the tool to read. You can also give directory names, the tool will search them for JAR files, Zip files, and .class files. They make up the old version of the codebase.

Mandatory:yes
Multiples:yes
Default value:true

-old-label value

Version name for the report.

Mandatory:no
Multiples:no
Default value:value of -old

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

It writes all differences into an XML document that follows the differences DTD.

Examples

This will compare old.jar to new.jar and write the report to result.xml. The title will say "Version old.jar to Version new.jar". You can adjust the title by supplying -old-label and -new-label to JarJarDiff.

    JarJarDiff -old old.jar -new new.jar -out report.xml
    DiffToHTML -in report.xml -out report.html

Class

com.jeantessier.dependencyfinder.cli.JarJarDiff


ListDeprecatedElements

Lists programming elements that are deprecated.

Synopsis

    ListDocumentedElements
        [-echo]
        [-help]
        [-out filename]
        [-time]
        [-verbose [filename]]
        [-version]
        [filename ...]

Description

Lists classes, interfaces, fields, constructors, and methods that were tagged as deprecated by using javadoc tags. If a class or interface is deprecated, it will list all its constructors, fields, and methods too.

Switches

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

Parameters

File names for JAR files, Zip files, and .class files for the tool to read. You can also give directory names, the tool will search them for JAR files, Zip files, and .class files.

Mandatory:no
Multiples:yes
Default value:".", the current directory

Output

List of package names, class names, and feature names that are deprecated, one per line.

You can pass this output to DependencyReporter to get a list of areas in your code that depend on deprecated APIs.

Examples

    ListDeprecatedElements -out deprecated_elements.txt rt.jar

Class

com.jeantessier.diff.ListDeprecatedElements


ListDiff

Compares two lists of programming elements and computes differences.

Synopsis

    ListDiff
        [-compress]
        [-dtd-prefix uri]
        [-echo]
        [-encoding name]
        [-help]
        [-indent-text text]
        [-name value]
        -new filename
        [-new-label value]
        -old filename
        [-old-label value]
        [-out filename]
        [-time]
        [-verbose]
        [-version]

Description

You use ListDiff to list changes in what is considered part of the published API. It only needs the lists generated by the doclet. No source or bytecode required.

Switches

-compress

Removes redundant entries from the both the removed and added lists. If a package is in a list, its classes and their features are redundant and can be removed. If a class is in a list, its feaures are redundant and can be removed.

Mandatory:no
Multiples:no
Default value:none

-dtd-prefix uri

The prefix of the DTD URL for the XML output document.

Mandatory:no
Multiples:no
Default value:http://depfind.sourceforge.net/dtd

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-encoding name

The encoding used for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:utf-8

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-indent-text text

Uses text for each indentation level in XML output.

Mandatory:no
Multiples:no
Default value:Four spaces, "    "

-name value

Project name for the report.

Mandatory:no
Multiples:no
Default value:none

-new filename

Input text file for the new version of the list.

Mandatory:no
Multiples:no
Default value:true

-new-label value

Version name for the report.

Mandatory:no
Multiples:no
Default value:value of -new

-old filename

Input text file for the old version of the list.

Mandatory:no
Multiples:no
Default value:true

-old-label value

Version name for the report.

Mandatory:no
Multiples:no
Default value:value of -old

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

It writes the list of differences into an XML document that follows the list-diff DTD.

Examples

Let's say that file old.txt is:

    Removed
    Same

And that file new.txt is:

    Same
    Added

Then ListDiff will show:

    ListDiff -name sample -old old.txt -new new.txt
    <?xml version="1.0" encoding="UTF-8" ?>
     
    <!DOCTYPE list-diff SYSTEM "http://depfind.sourceforge.net/dtd/list-diff.dtd">
     
    <list-diff>
        <name>sample</name>
        <old></old>
        <new></new>
        <removed>
            <line>Removed</line>
        </removed>
        <added>
            <line>Added</line>
        </added>
    </list-diff>

Class

com.jeantessier.dependencyfinder.cli.ListDiff


ListDiffToHTML

Converts the output of ListDiff to HTML.

Synopsis

    ListDiffToHTML
        -in input_file.xml
        [-out output_file.html]

Description

Converts the output of ListDiff to HTML.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the list-diff DTD, such as the output of ListDiff.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.html

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

    ListDiff -name sample -old old.txt -new new.txt -out listdiff.xml
    ListDiffToHTML -in listdiff.xml -out listdiff.html

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/ListDiffToHTML.xsl


ListDiffToText

Converts the output of ListDiff to human-readable text.

Synopsis

    ListDiffToText
        -in input_file.xml
        [-out output_file.txt]

Description

Converts the output of ListDiff to human-readable text.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the list-diff DTD, such as the output of ListDiff.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.txt

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

    ListDiff -name sample -old old.txt -old-label old -new new.txt -new-label new -out listdiff.xml
    ListDiffToHTML -in listdiff.xml
    sample - Documentation Changes
     
        old to new
     
        No Longer in Published API:
     
            - Removed
     
        Newly Published:
     
            - Added

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/ListDiffToText.xsl


ListDocumentedElements

Lists programming elements that are part of the published documentation.

Synopsis

    ListDocumentedElements
        [-invalid value]*
        [-out filename]
        -tag name
        [-valid value]*
        [param ...]

Description

Lists classes, interfaces, fields, constructors, and methods that were tagged as part of the published API by using custom javadoc tags.

This is a doclet that runs with javadoc.

Switches

-invalid value

If an element's JavaDoc tag value matches value, the element is not considered part of the published documentation.

Mandatory:no
Multiples:yes
Default value:none

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-tag name

Looks for name in JavaDoc tags to determine if an element is valid or invalid.

Mandatory:yes
Multiples:no
Default value:none

-valid value

If an element's JavaDoc tag value matches value, the element is considered part of the published documentation.

Mandatory:no
Multiples:yes
Default value:none

Parameters

All other switches and parameters are passed to javadoc.

Mandatory:no
Multiples:yes
Default value:none

Output

List of package names, class names, and feature names that make up the published documentation. Each name is maked with [P], [C], or [F] respectively to help ListDiff compress the lists.

You can pass this output to ListDiff to get a list additions and removals from the published documentation.

You can pass this output to JarJarDiff to further constrain the report and limit it to the published API.

Examples

    ListDocumentedElements -tag level -valid published -out documented_elements.txt

or, with Ant:

    <javadoc>
        <doclet name="com.jeantessier.diff.ListDocumentedElements"
                path="${classesDir}">
            <param name="-tag" value="level"/>
            <param name="-valid" value="published"/>
            <param name="-out" value="documented_elements.txt"/>
        </doclet>
    </javadoc>

Class

com.jeantessier.diff.ListDocumentedElements


ListInheritanceDiffToText

Lists inheritance changes in JarJarDiff reports.

Synopsis

    ListInheritanceDiffToText
        -in input_file.xml
        [-out output_file.txt]

Description

Looks at the report from JarJarDiff and lists classes and interfaces that have changed either their extends or their implements clauses.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the differences DTD, such as the output of JarJarDiff.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.txt

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

    JarJarDiff -old old.jar -new new.jar -out report.xml
    ListInheritanceDiffToText -in report.xml -out inheritance.txt

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/ListInheritanceDiffToText.xsl


ListSymbols

Lists all symbols it could find, based on parameters.

Synopsis

    ListSymbols
        [-class-names]
        [-echo]
        [-excludes value]*
        [-field-names]
        [-final-method-or-class-names]
        [-help]
        [-includes value]*
        [-local-names]
        [-method-names]
        [-non-private-field-names]
        [-out filename]
        [-time]
        [-verbose [filename]]
        [-version]
        [filename ...]

Description

Lists all the symbols in classes in a JAR file, Zip file, or directory.

Shows all class names and method names and field names. In addition, if the class files contain local variable tables (from -g passed to javac), it will list, for each method, its parameters and local variables.

Switches

-class-names

Lists names of classes.

Mandatory:no
Multiples:no
Default value:none

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-excludes value

A symbol must NOT match the regular expression in value for it to be included in the results.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-field-names

Lists names of fields.

Mandatory:no
Multiples:no
Default value:none

-final-method-or-class-names

Lists names of final methods or classes fields. With this switch, the tool only lists such classs and methods; no fields or local variables. Enum classes and anonymous inner classes are implicitly final, but they are not listed by the tool.

This switch lets you find areas of the code where you might have been too restrictive by preventing extension.

Mandatory:no
Multiples:no
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-includes value

A symbol must match the regular expression in value for it to be included in the results.

If there are multiples of this switch, the name must match at least one of them.

Mandatory:no
Multiples:yes
Default value://

-local-names

Lists names of local variables.

Mandatory:no
Multiples:no
Default value:none

-method-names

Lists names of methods.

Mandatory:no
Multiples:no
Default value:none

-non-private-field-names

Lists names of non-private, non-static fields. With this switch, the tool only lists such fields; no classes or methods or local variables.

This switch lets you find areas of the code where you might have been too lax by allowing access to members that should have been private.

Mandatory:no
Multiples:no
Default value:none

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

Mandatory:no
Multiples:no
Default value:none

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

Parameters

File names for JAR files, Zip files, and .class files for the tool to read. You can also give directory names, the tool will search them for JAR files, Zip files, and .class files.

Mandatory:no
Multiples:yes
Default value:".", the current directory

Output

List of fully qualified class name and method and field signatures, one per line, for all the classes the tool could find. For parameter names and local variable names, the fully qualified name of the owning method is given first, followed by a colon, then a space, then the parameter or varialble's name, in alphabetical order.

Examples

    ListSymbols classes\test.class
    test
    test.main(java.lang.String[])
    test.main(java.lang.String[]): args
    test.main(java.lang.String[]): c
    test.main(java.lang.String[]): ex
    test.test()
    test.test(): this

Class

com.jeantessier.dependencyfinder.cli.ListSymbols


ListUnused

Lists programming elements that have no inbound dependencies.

Synopsis

    ListUnused
        -in input_file.xml
        [-out output_file.txt]

Description

Lists programming elements that have no inbound dependencies. This does necessarily imply that the programming element is unused. It could be a method that gets called through an interface or a superclass declaration, or it could be an implementation class that is activated via reflection.

One particular case deals with static final constants. Some compilers, including Sun's javac, inline these constants directly in the bytecode if their type makes them suitable to inclusion in the constant pool section of the .class file. When this happens, there is no longer any dependency in the compiled bytecode and Dependency Finder cannot find any direct references to the constants. Then, ListUnused lists them as dead code, even though they are not in reality.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the dependencies DTD, such as the output of DependencyExtractor, DependencyReporter, or DependencyClosure.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.txt

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

Here is an example that uses the following dependency graph:

    Empty
     
    Bidirectional1 <---> Bidirectional2
     
    Outbound ----> Middle ----> Inbound
       |                           ^
       |                           |
       \---------------------------/

Running this tool on that graph yields this output:

    ListUnused sample.xml
     
        class Outbound
        class Empty

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/ListUnused.xsl


MetricsToHTML

Translates the whole report to HTML.

Synopsis

    MetricsToHTML
        -in input_file.xml
        [-out output_file.html]

Description

Translates the entire report to HTML. If the report includes expanded collection measurements, it will render them as hyperlinks to possible named anchors inside the HTML.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the metrics DTD, such as the output of OOMetrics.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.html

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the metrics report in metrics.xml to a hyperlinked HTML file:

    MetricsToHTML -in metrics.xml -out metrics.html

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/MetricsToHTML.xsl


MetricsToText

Translates the whole report to text.

Synopsis

    MetricsToText
        -in input_file.xml
        [-out output_file.html]

Description

Translates the entire report to text.

The resulting report is broken down by package, and then by class, and then by method. OOMetrics -txt lists all packages first, followed by all classes, and finally by all methods.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow the metrics DTD, such as the output of OOMetrics.

Mandatory:yes
Multiples:no
Default value:none

-out output_file.html

Where to put the outcome of the translation.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

See -out above.

Examples

To convert the dependency graph in metrics.xml to a text file:

    MetricsToText -in metrics.xml -out metrics.txt

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/MetricsToText.xsl


OOMetrics

Computes object-oriented metrics on a codebase.

Synopsis

    OOMetrics
        [-classes]
        [-configuration filename]
        [-csv]
        -default-configuration filename
        [-dtd-prefix uri]
        [-echo]
        [-enable-cross-class-measurements]
        [-encoding name]
        [-expand]
        [-filter-excludes-list filename]*
        [-filter-includes-list filename]*
        [-groups]
        [-help]
        [-indent-text text]
        [-methods]
        [-out filename]
        [-project]
        [-project-name value]
        [-reverse]
        [-scope-excludes-list filename]*
        [-scope-includes-list filename]*
        [-show-all-metrics]
        [-show-empty-metrics]
        [-show-hidden-measurements]
        [-sort name]
        [-time]
        [-txt]
        [-validate]
        [-verbose [filename]]
        [-version]
        [-xml]
        [filename ...]

Description

Computes a number of object-oriented software metrics from a JAR file, such as methods per class and depth of inheritance. It can aggregate values at the class, package, and / or project level.

Switches

-classes

Include class-related metrics.

Mandatory:no
Multiples:no
Default value:none

-configuration filename

The set of measurements to monitor on the codebase and list in the output report. See the user manual for the format of this file. It also includes instruction on how to customize it.

Mandatory:no
Multiples:no
Default value:none

-csv

Writes each section in its own CSV file, perfect for loading in Google Docs or Microsoft Excel and for charting.

Mandatory:no
Multiples:no
Default value:none

-default-configuration filename

The metrics configuration to use if the user does not specify one with -configuration. The launching scripts use this switch to point to the default configuration in <DEPENDENCYFINDER_HOME>/etc/MetricsConfig.xml.

Mandatory:yes
Multiples:no
Default value:true

-dtd-prefix uri

The prefix of the DTD URL for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:http://depfind.sourceforge.net/dtd

-echo

Prints the command-line, as seen by the tool.

Mandatory:no
Multiples:no
Default value:none

-enable-cross-class-measurements

Instructs OOMetrics to load all the classes before it starts computing metrics. This way, measurements that need to traverse other classes will be assured that those other classes are in memory and are available to them.

The default is for OOMetrics to load one class, compute its metrics, and then discard it. This keeps the memory requirements low. If you use this switch, it will require OOMetrics to keep all classes in memory and this can raise the memory footprint significantly.

One example of a measurement that requires cross-class computation is Depth Of Inheritance, which has OOMetrics walk the inheritance tree of each class to figure out how far it is from java.lang.Object.

Mandatory:no
Multiples:no
Default value:none

-encoding name

The encoding used for the XML output document. Only useful with -xml.

Mandatory:no
Multiples:no
Default value:utf-8

-expand

Lists the elements in NameListMeasurement and AccumulatorMeasurement measurements.

Mandatory:no
Multiples:no
Default value:none

-filter-excludes-list filename

The name of a package, class, or feature at the other end of the dependency must NOT match any of the entries in filename for the dependency to be accounted in the report.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-filter-includes-list filename

The name of a package, class, or feature at the other end of the dependency must match an entry in filename for the dependency to be accounted in the report.

If there are multiples of this switch, the name must match at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-groups

Include group- and package-related metrics.

Mandatory:no
Multiples:no
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-indent-text text

Uses text for each indentation level in textual and XML output.

Mandatory:no
Multiples:no
Default value:Four spaces, "    "

-methods

Include method-related metrics.

Mandatory:no
Multiples:no
Default value:none

-out filename

Writes the output to filename. If filename does not exists, it is created. If it already exists, its content is overwritten.

When used with -csv, filename is taken as a prefix to which the tool will append _project.csv, _groups.csv, _classes.csv and _methods.csv as needed to output each section of requested metrics.

Mandatory:no
Multiples:no
Default value:none

-project

Include project-related metrics.

Mandatory:no
Multiples:no
Default value:none

-project-name value

Project name for the report.

Mandatory:no
Multiples:no
Default value:Project

-reverse

When used with -sort, sorts in descending order.

Mandatory:no
Multiples:no
Default value:none

-scope-excludes-list filename

The name of a package, class, or feature must NOT match any of the entries in filename for it to be accounted in the report.

If there are multiples of this switch, the name must not match any of them.

Mandatory:no
Multiples:yes
Default value:none

-scope-includes-list filename

The name of a package, class, or feature must match an entry in filename for it to be accounted in the report.

If there are multiples of this switch, the name must at least one of them.

Mandatory:no
Multiples:yes
Default value:none

-show-all-metrics

Includes metrics on classes and methods that were not analysed directly, but may still have valid information gathered indirectly from other classes, such as inbound dependencies.

Mandatory:no
Multiples:no
Default value:none

-show-empty-metrics

Includes entries where analysis didn't gather any information.

Mandatory:no
Multiples:no
Default value:none

-show-hidden-measurements

Shows all measurements, even if they were meant to be hidden through their visiblity in the configuration. This is useful when trying to debug a complex configuration and tracking the flow of information.

Mandatory:no
Multiples:no
Default value:none

-sort name

Sort the elements based on the value of their name measurement. This is the short name defined in the configuration file. By default, sorts in ascending order of package, class, or method name (fully qualified).

Mandatory:no
Multiples:no
Default value:name

-time

Prints how long it took to run the command.

Mandatory:no
Multiples:no
Default value:none

-txt

Writes a single text report with all requested sections.

Mandatory:no
Multiples:no
Default value:none

-validate

Validate the input XML against its DTD.

Mandatory:no
Multiples:no
Default value:none

-verbose [filename]

Writes summary processing information to filename. If you do not specify a file, the tool will write the information to the standard output stream.

Mandatory:no
Multiples:no
Default value:System.out

-version

Prints version information.

Mandatory:no
Multiples:no
Default value:none

-xml

Writes the metrics report as an XML document with the metrics DTD.

Mandatory:no
Multiples:no
Default value:none

Parameters

File names for JAR files, Zip files, and .class files for the tool to read. You can also give directory names, the tool will search them for JAR files, Zip files, and .class files.

Mandatory:no
Multiples:yes
Default value:".", the current directory

Output

The normal output is the complete metrics report, sorted by whatever measurement you specified with -sort. This text report can be quite large. You can use -out filename to save the output to a file.

With -csv, formats the output as comma-separated values that can be fed to Google Docs or MS Excel. When coupled with -out prefix, it actually generates up to four files, one for each group of metrics:

With -xml, it converts the entire metrics structure into an XML document that follows the metrics DTD. You can use -out filename to save the output to a file.

Examples

To list all default metrics as text in df.txt:

    OOMetrics -txt -out df.txt DependencyFinder.jar

To list only package-level metrics from MartinConfig.xml as CSV in Ds_groups.csv:

    OOMetrics -configuration <DEPENDENCYFINDER_HOME>/etc/MartinConfig.xml -groups -csv -out Ds DependencyFinder.jar

Class

com.jeantessier.dependencyfinder.cli.OOMetrics


OOMetricsGUI

A Swing-based version of OOMetrics.

Synopsis

    OOMetricsGUI
        [-configuration filename]
        -default-configuration filename
        [-enable-cross-class-measurements]
        [-help]
        [-validate]

Description

A Swing-based application that combines the functionalities dealing with metrics.

See also:

Switches

-configuration filename

The set of measurements to monitor on the codebase and list in the output report. See the user manual for the format of this file. It also includes instruction on how to customize it.

Mandatory:no
Multiples:no
Default value:none

-default-configuration filename

The metrics configuration to use if the user does not specify one with -configuration. The launching scripts use this switch to point to the default configuration in <DEPENDENCYFINDER_HOME>/etc/MetricsConfig.xml.

Mandatory:yes
Multiples:no
Default value:true

-enable-cross-class-measurements

Instructs OOMetrics to load all the classes before it starts computing metrics. This way, measurements that need to traverse other classes will be assured that those other classes are in memory and are available to them.

The default is for OOMetrics to load one class, compute its metrics, and then discard it. This keeps the memory requirements low. If you use this switch, it will require OOMetrics to keep all classes in memory and this can raise the memory footprint significantly.

One example of a measurement that requires cross-class computation is Depth Of Inheritance, which has OOMetrics walk the inheritance tree of each class to figure out how far it is from java.lang.Object.

Mandatory:no
Multiples:no
Default value:none

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-validate

Validate the input XML against its DTD.

Mandatory:no
Multiples:no
Default value:none

Parameters

none

Output

none

Examples

See the user manual.

Class

com.jeantessier.dependencyfinder.gui.OOMetrics


XSLTProcess

Applies an XSL stylesheet to an XML document.

Synopsis

    XSLTProcess
        -in input_file.xml
        [-out filename]
        -xsl stylesheet.xsl

Description

This is a direct call to the processor that comes with Xalan. It is used by all the other XSL transform tools; their script simply hardcodes the appropriate -xsl value.

Switches

-in input_file.xml

The XML file to be translated. The document has to follow a DTD that is compatible with the stylesheet specified with -xsl.

Mandatory:yes
Multiples:no
Default value:none

-out filename

Where to put the outcome of the translation. The format of the output depends on the stylesheet you specify with -xsl.

If not specified, the translation goes to the standard output.

Mandatory:no
Multiples:no
Default value:none

-xsl stylesheet.xsl

The XSL transformation to apply to the XML document specified with -in.

Mandatory:yes
Multiples:no
Default value:none

Parameters

None.

Output

See -out above.

Examples

Instead of using DependablesToHTML, you can use:

    XSLTProcess -xsl <DEPENDENCYFINDER_HOME>/etc/DependablesToHTML.xsl -in dg.xml -out dependencies.html

Class

org.apache.xalan.xslt.Process


c2c

Same as "DependencyReporter -c2c".


c2p

Same as "DependencyReporter -c2p".


f2f

Same as "DependencyReporter -f2f".


p2p

Same as "DependencyReporter -p2p".