Removed half-baked java source code parser.
[javainspect.git] / src / main / java / eu / svjatoslav / inspector / java / RenderJavaInspect.java
1 /*
2  * JavaInspect - Utility to visualize java software
3  * Copyright (C) 2013-2020, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of version 3 of the GNU Lesser General Public License
7  * or later as published by the Free Software Foundation.
8  */
9
10 package eu.svjatoslav.inspector.java;
11
12 import eu.svjatoslav.inspector.java.structure.ClassGraph;
13 import eu.svjatoslav.inspector.java.structure.Utils;
14
15 public class RenderJavaInspect {
16
17     /**
18      * Running this method via IDE will produce 2 files in project root directory:
19      * JavaInspect.svg (JavaInspect utility visualizes itself) and
20      * JavaInspect.dot (GraphViz dot file, for reference).
21      */
22     private static void handpickClassesExample() {
23         /*
24          * This example demonstrates generating of class graph from hand picked
25          * classes and visualizing GraphViz itself.
26          */
27
28         // Create graph
29         final ClassGraph graph = new ClassGraph();
30
31         // Add some random object to the graph. GraphViz will detect Class from
32         // the object.
33         graph.add(graph);
34
35         // Also add some random class to the graph.
36         graph.add(Utils.class);
37
38         // Keep intermediary GraphViz DOT file for reference.
39         graph.setKeepDotFile(true);
40
41         // Produce SVG image titled "JavaInspect.svg" to the user Desktop
42         // directory
43         graph.generateGraph("JavaInspect");
44     }
45
46     public static void main(final String[] args) {
47
48         handpickClassesExample();
49     }
50 }