/[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.17 by julian, Mon Dec 20 21:27:52 2004 UTC revision 1.18 by julian, Tue Dec 21 13:34:33 2004 UTC
# Line 566  public class RootDocImpl Line 566  public class RootDocImpl
566           if (null != classDoc) {           if (null != classDoc) {
567    
568              if (classDoc instanceof ClassDocReflectedImpl) {              if (classDoc instanceof ClassDocReflectedImpl) {
                if (classDoc.qualifiedName().indexOf("Point2D") >= 0) {  
                   System.err.println("adding class doc: " + classDoc);  
                }  
569                 Main.getRootDoc().addClassDocRecursive(classDoc);                 Main.getRootDoc().addClassDocRecursive(classDoc);
570              }              }
571    
# Line 933  public class RootDocImpl Line 930  public class RootDocImpl
930        }        }
931     }     }
932    
933       private class ResolvedImportReflectionPackage
934          implements ResolvedImport
935       {
936          private String packagePrefix;
937    
938          ResolvedImportReflectionPackage(String packagePrefix)
939          {
940             this.packagePrefix = packagePrefix;
941          }
942    
943          public String toString()
944          {
945             return "ResolvedImportReflectionPackage{" + packagePrefix + ".*}";
946          }
947    
948          public String match(String name)
949          {
950             try {
951                Class clazz = Class.forName(packagePrefix + "." + name);
952                return clazz.getName();
953             }
954             catch (Exception e) {
955                return null;
956             }
957          }
958    
959          public boolean mismatch(String name)
960          {
961             return null == match(name);
962          }
963    
964          public ClassDoc tryFetch(String name)
965          {
966             try {
967                Class clazz = Class.forName(packagePrefix + name);
968                return ClassDocReflectedImpl.newInstance(clazz);
969             }
970             catch (Exception e) {
971                return null;
972             }
973          }
974    
975          public String getName()
976          {
977             return packagePrefix;
978          }
979       }
980    
981     private List unlocatablePrefixes = new LinkedList();     private List unlocatablePrefixes = new LinkedList();
982    
983     private ResolvedImport resolveImport(String importSpecifier)     private ResolvedImport resolveImport(String importSpecifier)
# Line 952  public class RootDocImpl Line 997  public class RootDocImpl
997        String importedPackageOrClass = importSpecifier;        String importedPackageOrClass = importSpecifier;
998        if (importedPackageOrClass.endsWith(".*")) {        if (importedPackageOrClass.endsWith(".*")) {
999           importedPackageOrClass = importedPackageOrClass.substring(0, importedPackageOrClass.length() - 2);           importedPackageOrClass = importedPackageOrClass.substring(0, importedPackageOrClass.length() - 2);
1000           return null;  
1001             return new ResolvedImportReflectionPackage(importedPackageOrClass);
1002            
1003             //return null;
1004        }        }
1005        else {        else {
1006           try {           try {
# Line 1017  public class RootDocImpl Line 1065  public class RootDocImpl
1065        }        }
1066    
1067        if (longestUnlocatablePrefix.length() > 0) {        if (longestUnlocatablePrefix.length() > 0) {
          System.err.println("adding unlocatablePrefix: " + longestUnlocatablePrefix);  
1068           unlocatablePrefixes.add(longestUnlocatablePrefix);           unlocatablePrefixes.add(longestUnlocatablePrefix);
1069        }        }
1070    
# Line 1044  public class RootDocImpl Line 1091  public class RootDocImpl
1091           String importSpecifier = (String)it.next();           String importSpecifier = (String)it.next();
1092           ResolvedImport resolvedImport = getResolvedImport(importSpecifier);           ResolvedImport resolvedImport = getResolvedImport(importSpecifier);
1093           String resolvedScheduledClassName = resolvedImport.match(className);           String resolvedScheduledClassName = resolvedImport.match(className);
1094    
1095           if (null != resolvedScheduledClassName) {           if (null != resolvedScheduledClassName) {
1096              return resolvedScheduledClassName;              return resolvedScheduledClassName;
1097           }           }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

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