From c505bd49b69970f4f8e1d4ae30933e1713d33d9b Mon Sep 17 00:00:00 2001
From: Svjatoslav Agejenko
After discovering application structure and optionally filtering out
unimportant parts, JavaInspect produces GraphViz dot file that
-describes data to be visualized. Then launches GraphViz to generate
+describes data to be visualized. Then launches GraphViz to generate
bitmap graph in PNG or SVG format.
-By default on your Desktop directory when operated in library mode or
-current working directory when operated as standalone commandline
-application.
-
Notes:
-
+declare at least some classes to be added to the graph by manually
+adding individual classes to the graph. For every class added to
+the graph, GraphViz will recursively inspect it and add all
+referecned classes to the graph as well.
@@ -457,7 +444,7 @@ and/or whitelist.
references) from the graph.
-// Create graph
-final ClassGraph graph = new ClassGraph();
+
// Create graph
+final ClassGraph graph = new ClassGraph();
-// Add some random object to the graph. GraphViz will detect Class from
-// the object.
+// Add some random object to the graph. GraphViz will detect Class from
+// the object.
graph.add(graph);
-// Also add some random class to the graph.
-graph.add(Utils.class);
+// Also add some random class to the graph.
+graph.add(Utils.class);
-// Keep intermediary GraphViz DOT file for reference.
-graph.setKeepDotFile(true);
+// Keep intermediary GraphViz DOT file for reference.
+graph.setKeepDotFile(true);
-// Produce bitmap image titled "JavaInspect.png" to the user Desktop
-// directory
-graph.generateGraph("JavaInspect");
+// Produce bitmap image titled "JavaInspect.png" to the user Desktop
+// directory
+graph.generateGraph("JavaInspect");
new ClassGraph().add(randomObject, RandomClass.class) - .setKeepDotFile(true).generateGraph("JavaInspect"); +new ClassGraph().add(randomObject, RandomClass.class) + .setKeepDotFile(true).generateGraph("JavaInspect");
// Create graph -final ClassGraph graph = new ClassGraph(); - -// Recursively scan current directory for Java source code and attempt -// to detect class names from there to be added to the graph. -graph.addProject("."); - -// Blacklist example classes from being shown on the graph -graph.blacklistClassPattern("eu.svjatoslav.inspector.java.structure.example.*"); - -// do not show single classes with no relationships on the graph -graph.hideOrphanedClasses(); - -// Produce bitmap image titled "JavaInspect full project.png" to the -// user Desktop directory. -graph.generateGraph("JavaInspect full project"); --
-Result: -
-Declare JavaInspect as dependency:
<dependencies> +<dependencies> ... - <dependency> - <groupId>eu.svjatoslav</groupId> - <artifactId>javainspect</artifactId> - <version>1.6</version> - </dependency> + <dependency> + <groupId>eu.svjatoslav</groupId> + <artifactId>javainspect</artifactId> + <version>1.7</version> + </dependency> ... -</dependencies> +</dependencies>
<repositories> +<repositories> ... - <repository> - <id>svjatoslav.eu</id> - <name>Svjatoslav repository</name> - <url>http://www2.svjatoslav.eu/maven/</url> - </repository> + <repository> + <id>svjatoslav.eu</id> + <name>Svjatoslav repository</name> + <url>http://www2.svjatoslav.eu/maven/</url> + </repository> ... -</repositories> +</repositories>
+Similar or alternative solutions: +
+ +