Search in sources :

Example 1 with FlatMethodCountExporter

use of com.google.classyshark.silverghost.exporter.FlatMethodCountExporter in project android-classyshark by google.

the class SilverGhostFacade method inspectPackages.

public static void inspectPackages(List<String> args) {
    String fileName = args.get(1);
    File file = new File(fileName);
    if (!file.exists()) {
        System.err.printf("File '%s' does not exist", fileName);
        return;
    }
    RootBuilder rootBuilder = new RootBuilder();
    MethodCountExporter methodCountExporter = new TreeMethodCountExporter(new PrintWriter(System.out));
    if (args.size() > 2) {
        for (int i = 2; i < args.size(); i++) {
            if (args.get(i).equals("-flat")) {
                methodCountExporter = new FlatMethodCountExporter(new PrintWriter(System.out));
            }
        }
    }
    ClassNode rootNode = rootBuilder.fillClassesWithMethods(fileName);
    methodCountExporter.exportMethodCounts(rootNode);
}
Also used : ClassNode(com.google.classyshark.silverghost.methodscounter.ClassNode) RootBuilder(com.google.classyshark.silverghost.methodscounter.RootBuilder) TreeMethodCountExporter(com.google.classyshark.silverghost.exporter.TreeMethodCountExporter) FlatMethodCountExporter(com.google.classyshark.silverghost.exporter.FlatMethodCountExporter) TreeMethodCountExporter(com.google.classyshark.silverghost.exporter.TreeMethodCountExporter) MethodCountExporter(com.google.classyshark.silverghost.exporter.MethodCountExporter) File(java.io.File) FlatMethodCountExporter(com.google.classyshark.silverghost.exporter.FlatMethodCountExporter) PrintWriter(java.io.PrintWriter)

Aggregations

FlatMethodCountExporter (com.google.classyshark.silverghost.exporter.FlatMethodCountExporter)1 MethodCountExporter (com.google.classyshark.silverghost.exporter.MethodCountExporter)1 TreeMethodCountExporter (com.google.classyshark.silverghost.exporter.TreeMethodCountExporter)1 ClassNode (com.google.classyshark.silverghost.methodscounter.ClassNode)1 RootBuilder (com.google.classyshark.silverghost.methodscounter.RootBuilder)1 File (java.io.File)1 PrintWriter (java.io.PrintWriter)1