예제 #1
0
  public TypeDeclarationArray getChildren(boolean onlyDirect) {
    TypeDeclarationArray result = new TypeDeclarationArrayImpl();
    Project project = ASTHelper.getProjectOf(_localType);
    Hashtable knownSubTypes = new Hashtable();
    Hashtable finishedTypes = new Hashtable();

    for (PackageIterator pkgIt = project.getPackages().getIterator(); pkgIt.hasNext(); ) {
      for (TypeDeclarationIterator typeIt = pkgIt.getNext().getTypes().getIterator();
          typeIt.hasNext(); ) {
        checkForSubType(typeIt.getNext(), knownSubTypes, finishedTypes, !onlyDirect);
      }
    }
    for (Enumeration en = knownSubTypes.elements(); en.hasMoreElements(); ) {
      result.add((TypeDeclaration) en.nextElement());
    }
    return result;
  }
예제 #2
0
  public boolean hasChildrenIn(Project prj) {
    for (PackageIterator pkgIter = prj.getPackages().getIterator(); pkgIter.hasNext(); ) {
      for (TypeDeclarationIterator typeIter = pkgIter.getNext().getTypes().getIterator();
          typeIter.hasNext(); ) {
        if (isChild(typeIter.getNext())) {
          return true;
        }
      }
    }

    return false;
  }
예제 #3
0
 public void visitProject(Project node) {
   for (CompilationUnitIterator iter = node.getCompilationUnits().getIterator();
       iter.hasNext(); ) {
     visit(iter.getNext());
   }
 }