예제 #1
0
 private JavaClass findClass(String classname) {
   for (JavaClass jClass : graph.vertexSet()) {
     if (jClass.getName().equals(classname)) {
       return jClass;
     }
   }
   return null;
 }
예제 #2
0
 public Set<String> getIndexedClasses() {
   Set<String> classes = newHashSet();
   Set<JavaClass> vertexSet = graph.vertexSet();
   for (JavaClass each : vertexSet) {
     classes.add(each.getName());
   }
   return classes;
 }
예제 #3
0
 public JavaClass findJavaClass(String classname) {
   JavaClass clazz = findClass(classname);
   if (clazz == null) {
     clazz = builder.getClass(classname);
     if (clazz.locatedInClassFile()) {
       addToIndex(clazz);
     }
   }
   return clazz;
 }
예제 #4
0
 private void updateParentReferences(JavaClass parentClass) {
   for (String child : parentClass.getImports()) {
     JavaClass childClass = findJavaClass(child);
     if ((childClass != null) && !childClass.equals(parentClass)) {
       if (graph.containsVertex(childClass)) {
         graph.addEdge(parentClass, childClass);
       }
     }
   }
 }