Description Download Running Related software
JavaSkeleton is a command line tool that builds a report about dependencies between java classes. It needs J2SE 1.4 or 1.3 with a JAXP compliant SAX parser for running.
The tool's job consists in first analyzing java classes from source files and then producing an XML document that reports the dependencies between the outer one classes. The structure of the XML document is given by this RELAX NG schema. An XSL style-sheet is also provided in order to produce an HTML report from the XML document. As an example of result, take a look at JavaSkeleton_1_0_skeleton, which has been obtained from the JavaSkeleton source files.
Dependencies are elaborated from class name references through declarations or statements (not in literals). In order to not have to do the whole job of a Java compiler, the tool makes some assumptions about naming : all class names - by speaking about classes, we include interfaces - are supposed to start with an upper case and all package, field and method names are supposed to start with a lower case. In the same way, a list of primary package identifier is used for control. The default list is (java
, javax
, org
, net
, com
, edu
). It may be enriched. All theses pseudo-rules allow some simplifications and make compiling more efficient. A warning is written out when a non respect of one of this rules can be detected.
For the predefined java.lang
package and for some packages that some sources may reference in import-on-demand declarations (.*
), the tool needs to obtain a list of outer class, as extra input. This extra input is provided through import files. An import file is an XML document that is in accordance with the same schema than the report document. The tool is also used to build import files. Import files for J2SE 1.4, SAX2 and DOM2 are provided.
JavaSkeleton is open source. It is developed as part of the xmloperator project and shares its license but is packaged and can be used independently from the other parts of the project.
G | R | C | Date | Executable | Source |
---|---|---|---|---|---|
1 | 0 | 0 | 2003-07-16 | jsk_1_0_0.zip (85Kb) | jsk_1_0_0_src.zip (66Kb) |
The java class archive is javaSkeleton.jar
. Its main class is org.xmloperator.java.skeleton.Compiler
.
command line arguments | ||
---|---|---|
argument | multiplicity | action |
-v | 0..1 | verbose : each step will start with writing out a message. |
-nw | 0..1 | no warning : no warning will be written out. |
-ppi xxx | 0..n | will add xxx to the list of primary package identifier. |
-import xxx.xml | 0..n | will import the xxx.xml file in order to be able to resolve some import-on-demand declarations. |
-si | 0..1 | self import : will add a first compilation pass in order to be able to resolve some import-on-demand declarations that reference the analyzed packages. |
-fi | 0..1 | for import : running purpose is building an import file, which will contain the package contents but no dependencies between classes. |
-pu | 0..1 | package use : will consolidate the class dependencies at the package level. |
-output xxx.xml | 1 | will use this pathname for report output. |
xxx.java | 0..n | will analyze this java source file. |
xxx.zip | 0..n | will analyze all the java source files that this archive contains. |
<directory> | 0..n | will analyze all the java source files that this directory contains, recursively. |
xxx.xml | 0..n | will merge this previously obtained skeleton. |
As an example, the following command builds a skeleton.xml
report file from the jsk_src.zip
source archive file :
java -cp javaSkeleton.jar org.xmloperator.java.skeleton.Compiler -import import_j2se_1_4_java.xml -import import_xml_sax_2.xml -output skeleton.xml jsk_src.zip
You could be interested by the following tools, whose object is near that this one. Both of them analyze the compiled class files rather than the source files, which presents some advantages.
Classycle : reports the cyclic dependencies between classes, including the one where inner classes are concerned.
JDepend : generates design quality metrics at the package level. This helps to effectively manage and control package dependencies.
Java is a trademark of Sun Microsystems, Inc. | |
Last update : 2003-07-16 | Copyright (c) 2000 - 2003 The_xmloperator_project |