forked from classgraph/classgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClassGraphGraphVizGenerator.java
More file actions
39 lines (37 loc) · 1.33 KB
/
ClassGraphGraphVizGenerator.java
File metadata and controls
39 lines (37 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import java.io.IOException;
import java.io.PrintWriter;
import io.github.classgraph.ClassGraph;
import io.github.classgraph.ScanResult;
/**
* ClassGraphGraphVizGenerator.
*/
public class ClassGraphGraphVizGenerator {
/**
* The main method.
*
* @param args
* the arguments
* @throws IOException
* Signals that an I/O exception has occurred.
*/
public static void main(final String[] args) throws IOException {
try (ScanResult scanResult = new ClassGraph() //
.acceptPackagesNonRecursive("io.github.classgraph") //
.enableMethodInfo() //
.ignoreMethodVisibility() //
.enableFieldInfo() //
.ignoreFieldVisibility() //
.enableAnnotationInfo() //
// .enableInterClassDependencies() //
// .verbose() //
.scan()) {
final String fileName = "/tmp/graph.dot";
try (PrintWriter writer = new PrintWriter(fileName)) {
writer.print(scanResult.getAllClasses()
// .generateGraphVizDotFileFromClassDependencies()
.generateGraphVizDotFile(12, 8, false, true, false, true, true));
}
System.out.println("Wrote " + fileName);
}
}
}