/[classpath]/gjdoc/src/gnu/classpath/tools/gjdoc/RootDocImpl.java
ViewVC logotype

Diff of /gjdoc/src/gnu/classpath/tools/gjdoc/RootDocImpl.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.20 by julian, Tue Mar 8 17:21:28 2005 UTC revision 1.21 by julian, Tue May 10 23:22:03 2005 UTC
# Line 204  public class RootDocImpl Line 204  public class RootDocImpl
204    
205        //--- Parse all files in "java.lang".        //--- Parse all files in "java.lang".
206    
207        File javaLangSources = findSourceFile("java/lang");        List javaLangSourceDirs = findSourceFiles("java/lang");
208        if (null!=javaLangSources) {        if (!javaLangSourceDirs.isEmpty()) {
209           parser.processSourceDir(javaLangSources, sourceEncoding, "java.lang");           Iterator it = javaLangSourceDirs.iterator();
210             while (it.hasNext()) {
211                File javaLangSourceDir = (File)it.next();
212                parser.processSourceDir(javaLangSourceDir,
213                                        sourceEncoding, "java.lang");
214             }
215        }        }
216        else {        else {
217    
# Line 224  public class RootDocImpl Line 229  public class RootDocImpl
229    
230           String specifiedPackageName = (String)it.next();           String specifiedPackageName = (String)it.next();
231           printNotice("Loading classes for package "+specifiedPackageName+"...");           printNotice("Loading classes for package "+specifiedPackageName+"...");
232           File sourceDir = findSourceFile(specifiedPackageName.replace('.',File.separatorChar));           List sourceDirs = findSourceFiles(specifiedPackageName.replace('.',File.separatorChar));
233           if (null!=sourceDir) {           if (!sourceDirs.isEmpty()) {
234              parser.processSourceDir(sourceDir, sourceEncoding, specifiedPackageName);              Iterator sourceDirIt = sourceDirs.iterator();
235                while (sourceDirIt.hasNext()) {
236                   File sourceDir = (File)sourceDirIt.next();
237                   parser.processSourceDir(sourceDir, sourceEncoding, specifiedPackageName);
238                }
239           }           }
240           else {           else {
241              printError("Package '"+specifiedPackageName+"' not found.");              printError("Package '"+specifiedPackageName+"' not found.");
# Line 370  public class RootDocImpl Line 379  public class RootDocImpl
379        }        }
380     }     }
381    
382     File findSourceFile(String relPath) {     List findSourceFiles(String relPath) {
383    
384          List result = new LinkedList();
385        for (Iterator it = sourcePath.iterator(); it.hasNext(); ) {        for (Iterator it = sourcePath.iterator(); it.hasNext(); ) {
386           File path = (File)it.next();           File path = (File)it.next();
387           File file = new File(path, relPath);           File file = new File(path, relPath);
388           if (file.exists()) return file;           if (file.exists()) {
389                result.add(file);
390             }
391        }        }
392    
393        return null;        return result;
394     }     }
395    
396     PackageDocImpl findOrCreatePackageDoc(String packageName) {     PackageDocImpl findOrCreatePackageDoc(String packageName) {
# Line 387  public class RootDocImpl Line 399  public class RootDocImpl
399           rc=new PackageDocImpl(packageName);           rc=new PackageDocImpl(packageName);
400           if (specifiedPackageNames.contains(packageName)) {           if (specifiedPackageNames.contains(packageName)) {
401              String packageDirectoryName = packageName.replace('.', File.separatorChar);              String packageDirectoryName = packageName.replace('.', File.separatorChar);
402              File packageDirectory = findSourceFile(packageDirectoryName);              List packageDirectories = findSourceFiles(packageDirectoryName);
403              File packageDocFile = new File(packageDirectory, "package.html");              Iterator it = packageDirectories.iterator();
404              rc.setPackageDirectory(packageDirectory);              boolean packageDocFound = false;
405              if (null!=packageDocFile && packageDocFile.exists()) {              while (it.hasNext()) {
406                 try {                 File packageDirectory = (File)it.next();
407                    rc.setRawCommentText(readHtmlBody(packageDocFile));                 File packageDocFile = new File(packageDirectory, "package.html");
408                 }                 rc.setPackageDirectory(packageDirectory);
409                 catch (IOException e) {                 packageDocFound = true;
410                    printWarning("Error while reading documentation for package "+packageName+": "+e.getMessage());                 if (null!=packageDocFile && packageDocFile.exists()) {
411                 }                    try {
412              }                       rc.setRawCommentText(readHtmlBody(packageDocFile));
413              else {                    }
414                 printNotice("No description found for package "+packageName);                    catch (IOException e) {
415              }                       printWarning("Error while reading documentation for package "+packageName+": "+e.getMessage());
416                      }
417                      break;
418                   }
419                }
420                if (!packageDocFound) {
421                   printNotice("No description found for package "+packageName);
422                }
423           }           }
424           addPackageDoc(rc);           addPackageDoc(rc);
425        }        }

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26