in xbean-finder/src/main/java/org/apache/xbean/finder/AnnotationFinder.java [87:123]
private AnnotationFinder(AnnotationFinder parent, Iterable<String> classNames) {
this.archive = new SubArchive(classNames);
this.checkRuntimeAnnotation = parent.checkRuntimeAnnotation;
this.metaroots.addAll(parent.metaroots);
for (Class<? extends Annotation> metaroot : metaroots) {
final ClassInfo info = parent.classInfos.get(metaroot.getName());
if (info == null) continue;
readClassDef(info);
}
for (String name : classNames) {
final ClassInfo info = parent.classInfos.get(name);
if (info == null) continue;
readClassDef(info);
}
resolveAnnotations(parent, new LinkedList<String>());
for (ClassInfo classInfo : classInfos.values()) {
if (isMetaRoot(classInfo)) {
try {
metaroots.add((Class<? extends Annotation>) classInfo.get());
} catch (ClassNotFoundException e) {
classesNotLoaded.add(classInfo.getName());
}
}
}
for (Class<? extends Annotation> metaroot : metaroots) {
List<Info> infoList = annotated.get(metaroot.getName());
for (Info info : infoList) {
final String className = info.getName() + "$$";
final ClassInfo i = parent.classInfos.get(className);
if (i == null) continue;
readClassDef(i);
}
}
}