X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Finspector%2Fjava%2Fmethods%2FProjectScanner.java;h=aaeacd4839138ddfa49787e90faf2180aaa82211;hb=c36bb542027754d394639170b96348439257103b;hp=3ed5a316e1cb97e5fa7cacf0854b081b33c8f39a;hpb=9811fe796d6f549151ab904714e1a65ff2839ee2;p=javainspect.git diff --git a/src/main/java/eu/svjatoslav/inspector/java/methods/ProjectScanner.java b/src/main/java/eu/svjatoslav/inspector/java/methods/ProjectScanner.java index 3ed5a31..aaeacd4 100644 --- a/src/main/java/eu/svjatoslav/inspector/java/methods/ProjectScanner.java +++ b/src/main/java/eu/svjatoslav/inspector/java/methods/ProjectScanner.java @@ -2,23 +2,36 @@ package eu.svjatoslav.inspector.java.methods; import java.io.File; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import eu.svjatoslav.commons.file.FilePathParser; -import eu.svjatoslav.inspector.tokenizer.InvalidSyntaxException; +import eu.svjatoslav.commons.string.tokenizer.InvalidSyntaxException; public class ProjectScanner { private final File scanPath; Map projects = new HashMap(); + public List javaFiles = new ArrayList(); public ProjectScanner(final File projectPath) { scanPath = projectPath; parse(); } + public List getAllClasses() { + final List result = new ArrayList(); + + for (final JavaFile file : javaFiles) + for (final Clazz clazz : file.classes) + result.add(clazz); + + return result; + } + public void parse() { if (!scanPath.exists()) @@ -51,6 +64,7 @@ public class ProjectScanner { if ("java".equalsIgnoreCase(fileExtension)) try { final JavaFile javaFile = new JavaFile(file); + javaFiles.add(javaFile); } catch (final IOException e) { System.out.println("Error parsing file: " + file.toString() + ": " + e.toString());