Exemple #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;
  }
Exemple #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;
  }
 public void visitProject(Project node) {
   for (CompilationUnitIterator iter = node.getCompilationUnits().getIterator();
       iter.hasNext(); ) {
     visit(iter.getNext());
   }
 }