use of org.eclipse.ceylon.model.loader.impl.reflect.mirror.ReflectionClass in project ceylon by eclipse.
the class Metamodel method getJavaClass.
public static java.lang.Class<?> getJavaClass(org.eclipse.ceylon.model.typechecker.model.Module module) {
if (module.isJava() || module.isDefaultModule()) {
// Java modules don't have module descriptor classes
return null;
}
String className = module.getNameAsString() + "." + NamingBase.MODULE_DESCRIPTOR_CLASS_NAME;
ReflectionClass classMirror = classMirror(module, className);
return classMirror.klass;
}
use of org.eclipse.ceylon.model.loader.impl.reflect.mirror.ReflectionClass in project ceylon by eclipse.
the class Metamodel method getJavaClass.
public static java.lang.Class<?> getJavaClass(org.eclipse.ceylon.model.typechecker.model.Package pkg) {
String className = ((LazyPackage) pkg).getNameAsString() + "." + NamingBase.PACKAGE_DESCRIPTOR_CLASS_NAME;
ReflectionClass classMirror = (ReflectionClass) moduleManager.getModelLoader().lookupClassMirror(pkg.getModule(), className);
return classMirror != null ? classMirror.klass : null;
}
use of org.eclipse.ceylon.model.loader.impl.reflect.mirror.ReflectionClass in project ceylon by eclipse.
the class RuntimeModelLoader method lazyLoadModule.
@Override
public void lazyLoadModule(Module module) {
if (isDynamicMetamodel()) {
if (loadCompiledModule(module)) {
String pkgName = module.getNameAsString();
ClassMirror moduleClass = findModuleClass(module, pkgName);
Class<?> klass = ((ReflectionClass) moduleClass).klass;
String path = klass.getProtectionDomain().getCodeSource().getLocation().getPath();
Unit u = new Unit();
// FIXME: find path name?
u.setFilename(path);
u.setFullPath(path);
module.setUnit(u);
}
}
}
Aggregations