use of org.eclipse.ceylon.compiler.java.runtime.metamodel.decl.ModuleImpl in project ceylon by eclipse.
the class Metamodel method getModuleList.
public static Sequential<? extends ceylon.language.meta.declaration.Module> getModuleList() {
// FIXME: this probably needs synchronisation to avoid new modules loaded during traversal
Set<org.eclipse.ceylon.model.typechecker.model.Module> modules = moduleManager.getModules().getListOfModules();
org.eclipse.ceylon.model.typechecker.model.Module[] view = new org.eclipse.ceylon.model.typechecker.model.Module[modules.size()];
modules.toArray(view);
ceylon.language.meta.declaration.Module[] array = new ceylon.language.meta.declaration.Module[view.length];
int i = 0;
for (org.eclipse.ceylon.model.typechecker.model.Module module : view) {
// optional means don't throw if it's not available
ModuleImpl mod = getOrCreateMetamodel(null, module, null, true);
// skip unavailable modules
if (mod != null)
array[i++] = mod;
}
ObjectArrayIterable<ceylon.language.meta.declaration.Module> iterable = new ObjectArrayIterable<ceylon.language.meta.declaration.Module>(ceylon.language.meta.declaration.Module.$TypeDescriptor$, array);
return iterable.take(i).sequence();
}
Aggregations