use of org.eclipse.jdt.internal.compiler.ast.ModuleReference in project spoon by INRIA.
the class JDTTreeBuilderHelper method createModuleExport.
CtPackageExport createModuleExport(ExportsStatement exportsStatement) {
String packageName = new String(exportsStatement.pkgName);
int sourceStart = exportsStatement.sourceStart;
int sourceEnd = exportsStatement.sourceEnd;
CtPackageReference ctPackageReference = jdtTreeBuilder.references.getPackageReference(packageName);
CtPackageExport moduleExport = jdtTreeBuilder.getFactory().Module().createPackageExport(ctPackageReference);
if (exportsStatement.targets != null && exportsStatement.targets.length > 0) {
List<CtModuleReference> moduleReferences = new ArrayList<>();
for (ModuleReference moduleReference : exportsStatement.targets) {
moduleReferences.add(this.jdtTreeBuilder.references.getModuleReference(moduleReference));
}
moduleExport.setTargetExport(moduleReferences);
}
moduleExport.setPosition(this.jdtTreeBuilder.getPositionBuilder().buildPosition(sourceStart, sourceEnd));
return moduleExport;
}
use of org.eclipse.jdt.internal.compiler.ast.ModuleReference in project spoon by INRIA.
the class JDTTreeBuilderHelper method createModuleExport.
CtPackageExport createModuleExport(OpensStatement opensStatement) {
String packageName = new String(opensStatement.pkgName);
int sourceStart = opensStatement.sourceStart;
int sourceEnd = opensStatement.sourceEnd;
CtPackageReference ctPackageReference = jdtTreeBuilder.references.getPackageReference(packageName);
CtPackageExport moduleExport = jdtTreeBuilder.getFactory().Module().createPackageExport(ctPackageReference);
if (opensStatement.targets != null && opensStatement.targets.length > 0) {
List<CtModuleReference> moduleReferences = new ArrayList<>();
for (ModuleReference moduleReference : opensStatement.targets) {
moduleReferences.add(this.jdtTreeBuilder.references.getModuleReference(moduleReference));
}
moduleExport.setTargetExport(moduleReferences);
}
moduleExport.setPosition(this.jdtTreeBuilder.getPositionBuilder().buildPosition(sourceStart, sourceEnd));
return moduleExport;
}
Aggregations