1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
\r
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
\r
5 <title>JavaInspect</title>
\r
8 <h1>JavaInspect - Utility to visualize java software</h1>
\r
10 href="http://www2.svjatoslav.eu/gitweb/?p=javainspect.git;a=snapshot;h=HEAD;sf=tgz">Download</a>
\r
13 href="http://www2.svjatoslav.eu/gitbrowse/javainspect/doc/index.html">Online
\r
14 homepage</a>
\r
15 <a href="http://svjatoslav.eu/programs.jsp">Other applications
\r
16 hosted on svjatoslav.eu</a>
\r
18 <b>Program author:</b>
\r
20 Homepage: <a href="http://svjatoslav.eu">http://svjatoslav.eu</a>
\r
21 Email: <a href="mailto:svjatoslav@svjatoslav.eu">svjatoslav@svjatoslav.eu</a>
\r
23 This software is distributed under <a
\r
24 href="http://www.gnu.org/licenses/gpl-2.0.html">GNU GENERAL PUBLIC LICENSE Version 2</a>.
\r
30 Goal: simplify/speed up understanding the computer program code by
\r
31 automatically visualizing its structure.
\r
34 JavaInspect is a Java library that you can embed into your Java project
\r
35 with a few lines of Maven configuration and then visualize any part of
\r
36 your Java program structure with few simple JavaInspect API calls at
\r
37 application runtime.
\r
40 <br /> JavaInspect uses Java reflection to discover class relations and
\r
41 structure and produces GraphViz dot file that describes your
\r
42 application. Then launches GraphViz to generate bitmap graph in PNG
\r
43 format on your Desktop directory.
\r
46 <h2>Current status</h2>
\r
48 This is simple utility, quickly written. Tested on Linux (can be
\r
49 relatively simply ported to other operating systems too). So far I used
\r
50 it for my own needs. There might be bugs and missing features. Feedback
\r
51 and code contributions are welcome.
\r
54 <h2>Example graphs</h2>
\r
56 Example visualization of
\r
57 <a href="http://www2.svjatoslav.eu/gitbrowse/sixth/doc/">Sixth</a>
\r
60 href="http://www2.svjatoslav.eu/gitbrowse/sixth/doc/architecture%20graphs/index.html">architecture
\r
64 <br /> A very simple example:
\r
66 <a href="example.png"><img src="example.resized.png" /></a>
\r
68 <br /> Graph legend:
\r
70 <img src="legend.png" />
\r
73 <h2>Usage example 1</h2>
\r
78 * This example demonstrates generating of class graph from hand picked
\r
83 final ClassGraph graph = new ClassGraph();
\r
85 // While classes and objects can be immediately passed to ClassGraph
\r
86 // constructor as arguments, it is also possible to add then one by one
\r
87 // as in the following example.
\r
89 // Add some object to the graph.
\r
90 graph.addObject(graph);
\r
92 // Add some class to the graph.
\r
93 graph.addClass(Utils.class);
\r
95 // Produce bitmap image titled "JavaInspect.png" to the user Desktop
\r
96 // directory and keep intermediary GraphViz DOT file for reference.
\r
97 graph.generateGraph("JavaInspect", true);
\r
102 Generated DOT file: <a href="JavaInspect.dot">JavaInspect.dot</a>
\r
103 Generated PNG image: <a href="JavaInspect.png">JavaInspect.png</a>
\r
108 <h2>Usage example 2</h2>
\r
112 // Recursively scan current directory for Java source code and attempt
\r
113 // to detect class names from there to be added to the graph.
\r
114 graph.addProject(".");
\r
116 // Blacklist example classes from being shown on the graph
\r
117 graph.getFilter().blacklistClassPattern(
\r
118 "eu.svjatoslav.inspector.java.structure.example.*");
\r
120 // do not show single classes with no relationships on the graph
\r
121 graph.hideOrphanedClasses();
\r
123 // Produce bitmap image titled "JavaInspect full project.png" to the
\r
124 // user Desktop directory.
\r
125 graph.generateGraph("JavaInspect full project");
\r
130 Generated PNG image: <a href="JavaInspect full project.png">JavaInspect full project.png</a>
\r
136 <h2>Embedding JavaInspect in your project</h2>
\r
139 Declare JavaInspect as dependency:
\r
141 <dependencies>
\r
146 <groupId>eu.svjatoslav</groupId>
\r
147 <artifactId>javainspect</artifactId>
\r
148 <version>1.2</version>
\r
149 </dependency>
\r
151 </dependencies>
\r
155 Add Maven repository to retrieve artifact from:
\r
157 <repositories>
\r
159 <id>svjatoslav.eu</id>
\r
160 <name>Svjatoslav repository</name>
\r
161 <url>http://www2.svjatoslav.eu/maven/</url>
\r
162 </repository>
\r
163 </repositories>
\r
169 <h2>Requirements</h2>
\r
172 <a href="http://www.graphviz.org/">GraphViz</a> - shall be installed on
\r