Tools in Dependency Finder


Table of Contents

Alphabetical Dependencies Metrics API Differences Classfile Utilities

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


ClassList

Lists all classes it could find, based on parameters.

Synopsis

    ClassList
    	[-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

-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 it for .class files and read them.

Mandatory:no
Multiples:yes
Default value: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\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
    	[-help]
    	[-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

-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

-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 it for .class files and read them.

Mandatory:no
Multiples:yes
Default value: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]
    	[-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

-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 it for .class files and read them.

Mandatory:yes
Multiples:yes
Default value:Current directory, "."

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" standalone="yes" ?>
     
    <!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.

Synopsis

    DependencyClosure
    	[-all]
    	[-c2c]
    	[-c2p]
    	[-class-filter]
    	[-class-filter-excludes value]*
    	[-class-filter-includes value]*
    	[-class-scope]
    	[-class-scope-excludes value]*
    	[-class-scope-includes value]*
    	[-dtd-prefix uri]
    	[-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-includes value]*
    	[-help]
    	[-includes value]*
    	[-indent-text text]
    	[-maximum-inbound-depth [value]]
    	[-maximum-outbound-depth [value]]
    	[-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-includes value]*
    	[-serialize]
    	[-time]
    	[-validate]
    	[-verbose [filename]]
    	[-version]
    	[-xml]
	graph.xml
	...

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 outbound dependencies without visiting any element twice.

One limitation: the graph must be maximized for anything other than feature-to-feature queries. Because of a limitation in the closure computation, it does not detect implicit dependencies and only follows dependencies that have been made explicit.

See also:

Switches

-all

Shorthand for the combination of:

  • -package-scope
  • -class-scope
  • -feature-scope
  • -package-filter
  • -class-filter
  • -feature-filter
Mandatory:no
Multiples:no
Default value:none

-c2c

Shorthand for the combination of:

  • -class-scope
  • -class-filter
Mandatory:no
Multiples:no
Default value:none

-c2p

Shorthand for the combination of:

  • -class-scope
  • -package-filter
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

-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

-excludes value

Shorthand for the combination of:

  • -scope-excludes value
  • -filter-excludes value
Mandatory:no
Multiples:yes
Default value:none

-f2f

Shorthand for the combination of:

  • -feature-scope
  • -feature-filter
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-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://

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-includes value

Shorthand for the combination of:

  • -scope-includes value
  • -filter-includes value
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, "    "

-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 closure will not follow any inbound dependencies.

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

-p2p

Shorthand for the combination of:

  • -package-scope
  • -package-filter
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-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://

-serialize

Writes the dependency graph as serialized Java objects.

At this time, Dependency Finder cannot deserialize a saved graph, so this switch is pretty useless.

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.

At this time, the tool cannot read serialized graphs.

Mandatory:yes
Multiples:yes
Default value:none

Output

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

With -ser, it serializes the resulting dependency graph with Java serialization.

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 -c2c -scope-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


DependencyExtractor

Extracts dependencies from compiled classes.

Synopsis

    DependencyExtractor
    	[-dtd-prefix uri]
    	[-help]
    	[-indent-text text]
    	[-maximize]
    	[-minimize]
    	[-out filename]
    	[-serialize]
    	[-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

-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

-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

-serialize

Writes the dependency graph as serialized Java objects.

At this time, Dependency Finder cannot deserialize a saved graph, so this switch is pretty useless.

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 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 it for .class files and read them.

At this time, the tool cannot read serialized graphs.

Mandatory:no
Multiples:yes
Default value:Current directory, "."

Output

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

With -ser, it serializes the entire dependency graph with Java serialization.

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, 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]
    	[-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

-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


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. List 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


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


DependencyMetrics

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

Synopsis

    DependencyMetrics
    	[-all]
    	[-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]*
    	[-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-includes value]*
    	[-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-includes value]*
    	[-time]
    	[-validate]
    	[-verbose [filename]]
    	[-version]
	graph.xml
	...

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

-all

Shorthand for the combination of:

  • -package-scope
  • -class-scope
  • -feature-scope
  • -package-filter
  • -class-filter
  • -feature-filter
Mandatory:no
Multiples:no
Default value:none

-c2c

Shorthand for the combination of:

  • -class-scope
  • -class-filter
Mandatory:no
Multiples:no
Default value:none

-c2p

Shorthand for the combination of:

  • -class-scope
  • -package-filter
Mandatory:no
Multiples:no
Default value:none

-chart-all

Shorthand for the combination of:

  • -chart-classes-per-package
  • -chart-features-per-class
  • -chart-inbounds-per-package
  • -chart-outbounds-per-package
  • -chart-inbounds-per-class
  • -chart-outbounds-per-class
  • -chart-inbounds-per-feature
  • -chart-outbounds-per-feature
Mandatory:no
Multiples:no
Default value:none

-chart-classes

Shorthand for the combination of:

  • -chart-features-per-class
  • -chart-inbounds-per-class
  • -chart-outbounds-per-class
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:

  • -chart-inbounds-per-feature
  • -chart-outbounds-per-feature
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:

  • -chart-inbounds-per-package
  • -chart-inbounds-per-class
  • -chart-inbounds-per-feature
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:

  • -chart-outbounds-per-package
  • -chart-outbounds-per-class
  • -chart-outbounds-per-feature
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:

  • -chart-classes-per-package
  • -chart-inbounds-per-package
  • -chart-outbounds-per-package
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

-excludes value

Shorthand for the combination of:

  • -scope-excludes value
  • -filter-excludes value
Mandatory:no
Multiples:yes
Default value:none

-f2f

Shorthand for the combination of:

  • -feature-scope
  • -feature-filter
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-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://

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-includes value

Shorthand for the combination of:

  • -scope-includes value
  • -filter-includes value
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:

  • -package-scope
  • -package-filter
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-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://

-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.

Mandatory:yes
Multiples:yes
Default value:none

Output

The output format is self-explanatory.

Examples

Here is a sample output:

    DependencyExtractor -xml -out test.xml classes\test.class
    DependencyMetrics -all 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 -all -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)

Class

com.jeantessier.dependencyfinder.cli.DependencyMetrics


DependencyReporter

Summarizes a dependency graph according to user-specified criteria.

Synopsis

    DependencyReporter
    	[-all]
    	[-c2c]
    	[-c2p]
    	[-class-filter
    	[-class-filter-excludes value]*
    	[-class-filter-includes value]*
    	[-class-scope]
    	[-class-scope-excludes value]*
    	[-class-scope-includes value]*
    	[-dtd-prefix uri]
    	[-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-includes value]*
    	[-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-includes value]*
    	[-serialize]
    	[-time]
    	[-validate]
    	[-verbose [filename]]
    	[-version]
    	[-xml]
	graph.xml
	...

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.

See also:

Switches

-all

Shorthand for the combination of:

  • -package-scope
  • -class-scope
  • -feature-scope
  • -package-filter
  • -class-filter
  • -feature-filter
Mandatory:no
Multiples:no
Default value:none

-c2c

Shorthand for the combination of:

  • -class-scope
  • -class-filter

See also:

Mandatory:no
Multiples:no
Default value:none

-c2p

Shorthand for the combination of:

  • -class-scope
  • -package-filter

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

-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

-excludes value

Shorthand for the combination of:

  • -scope-excludes value
  • -filter-excludes value
Mandatory:no
Multiples:yes
Default value:none

-f2f

Shorthand for the combination of:

  • -feature-scope
  • -feature-filter

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-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://

-help

Prints synopsis.

Mandatory:no
Multiples:no
Default value:none

-includes value

Shorthand for the combination of:

  • -scope-includes value
  • -filter-includes value
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:

  • -package-scope
  • -package-filter

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-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://

-serialize

Writes the dependency graph as serialized Java objects.

At this time, Dependency Finder cannot deserialize a saved graph, so this switch is pretty useless.

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.

At this time, the tool cannot read serialized graphs.

Mandatory:yes
Multiples:yes
Default value:none

Output

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

With -ser, it serializes the resulting dependency graph with Java serialization.

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

Examples

    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


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


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


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


JarJarDiff

Computes API differences between two versions of a codebase.

Synopsis

    JarJarDiff
    	[-dtd-prefix uri]
    	[-help]
    	[-indent-text text]
    	[-name value]
    	[-new filename]+
    	[-new-documentation filename]
    	[-new-label value]
    	[-old filename]+
    	[-old-documentation 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 and PublishedDiffToHTML to render the report in HTML. The second one is more restrictive as to what gets included in the report, so you can limit the report to "public" changes.

Switches

-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

-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

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 it for .class files and read them. These make up the new version of the codebase.

Mandatory:yes
Multiples:yes
Default value:none

-new-documentation filename

Location of the file with the list of published programming elements in the new version of the codebase. If omitted, the tool reports on all programming elements.

Mandatory:no
Multiples:no
Default value:new_documentation.txt

-new-label value

Version name for the report.

Mandatory:no
Multiples:no
Default value:none

-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 it for .class files and read them. These make up the old version of the codebase.

Mandatory:yes
Multiples:yes
Default value:true

-old-documentation filename

Location of the file with the list of published programming elements in the old version of the codebase. If omitted, the tool reports on all programming elements.

Mandatory:no
Multiples:no
Default value:old_documentation.txt

-old-label value

Version name for the report.

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

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 result.xml
    DiffToHTML -in result.xml -out internal_report.html
    PublishedDiffToHTML -in result.xml -out external_report.html

Because DOS only allows 9 parameters to .bat files, we cannot use -out in the following and we must use output redirection (the ">") instead. The next two XSLT steps are identical.

    JarJarDiff -old old.jar -old-label 3.0.2 -new new.jar -new-label 3.5 > result.xml
    DiffToHTML -in result.xml -out internal_report.html
    PublishedDiffToHTML -in result.xml -out external_report.html

Class

com.jeantessier.dependencyfinder.cli.JarJarDiff


ListDiff

Compares two lists of programming elements and computes differences.

Synopsis

    ListDiff
    	[-compress]
    	[-dtd-prefix uri]
    	[-help]
    	[-indent-text text]
    	[-name value]
    	-new filename
    	[-new-label value]
    	-old filename
    	[-old-label value]
    	[-out filename]
    	[-time]
    	[-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

-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:none

-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: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

-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 PublishedDiffToHTML to further restrain the report and limit it to the published API.

Examples

    ListDocumentableElements -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


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


OOMetrics

Computes object-oriented metrics on a codebase.

Synopsis

    OOMetrics
    	[-all]
    	[-classes]
    	[-configuration filename]
    	[-csv]
    	-default-configuration filename
    	[-dtd-prefix uri]
    	[-expand]
    	[-groups]
    	[-help]
    	[-indent-text text]
    	[-methods]
    	[-out filename]
    	[-project]
    	[-project-name value]
    	[-reverse]
    	[-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

-all

Shorthand for the combination of:

  • -project
  • -groups
  • -classes
  • -methods
Mandatory:no
Multiples:no
Default value:none

-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 Microsoft Excel and 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

-expand

Lists the elements in NameListMeasurement and AccumulatorMeasurement measurements.

Mandatory:no
Multiples:no
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 prefix

Writes the output to a file starting wit prefix. The rest of the name depends on the output format. If the file does not exists, it is created. If it already exists, its content is overwritten.

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

-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 it for .class files and read them.

Mandatory:no
Multiples:yes
Default value: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. If you use -out to save the output to a file, the file will be given a .txt extension.

With -csv, formats the output as comma-separated values that can be fed to MS Excel. When coupled with -out prefix, it actually generates 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. If you use -out to save the output to a file, the file will be given a .xml extension.

Examples

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

    OOMetrics -all -out df DependencyFinder.jar

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

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

Class

com.jeantessier.dependencyfinder.cli.OOMetrics


OOMetricsGUI

A Swing-based version of OOMetrics.

Synopsis

    OOMetricsGUI
    	[-configuration filename]
    	-default-configuration filename
    	[-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

-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


PublishedDiffToHTML

Converts the output of JarJarDiff to HTML, but limits it to the published interface, the one that you expose to your customers.

Synopsis

    PublishedDiffToHTML
    	-in input_file.xml
    	[-out output_file.html]
    	[-param validation-list list.txt]

Description

PublishedDiffToHTML uses the file %%DEPENDENCYFINDER_HOME%\etc\public_packages.txt by default to limit the report to the specified packages. If it cannot find this file, it looks for a file named public_packages.txt in the current directory. You can specify a custom file by setting the validation-list parameter to XSLT:

    PublishedDiffToHTML -in result.xml -out external_report.html -param validation-list my_list.txt

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

-param validation-list list.txt

Uses the list of element names in list.txt to limit the scope of the report to only the listed elements. If the file does not exist, the tool uses all public and all protected elements.

Mandatory:no
Multiples:no
Default value:%DEPENDENCYFINDER_HOME%\etc\public_packages.txt

Parameters

none

Output

See -out above.

Examples

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

    PublishedDiffToHTML -in report.xml

Here is a larger example with a defined published documentation:

    ListDocumentedElements -tag level -valid published -out old.txt old
    ListDocumentedElements -tag level -valid published -out new.txt new
    JarJarDiff -old old.jar -old-documentation old.txt -new new.jar -new-documentation new.txt -out report.xml
    PublishedDiffToHTML -in report.xml -param validation-list new.txt -out public-report.html

Class

org.apache.xalan.xslt.Process

XSL Stylesheet

<DEPENDENCYFINDER_HOME>/etc/PublishedDiffToHTML.xsl


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".