forName static method
Return the ClassMirror of the qualified class name
qname
- qualified class name (libname.classname), such asdart:core.List
andrikulo_mirrors.ClassMirror
.
Implementation
static ClassMirror forName(String qname) {
final splited = _splitQualifiedName(qname);
try {
final lib = currentMirrorSystem().findLibrary(Symbol(splited["lib"]!)),
klass = lib.declarations[Symbol(splited["class"]!)];
if (klass is ClassMirror)
return klass;
} catch (e) {
// findLibrary now throws if the symbol isn't there.
throw NoSuchClassError(qname);
}
throw NoSuchClassError(qname);
}