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 |
|
|
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) |
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 { |
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 |
|
|
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 |
} |
} |