use of com.linkedin.data.grammar.PdlParser.ImportDeclarationContext in project rest.li by linkedin.
the class PdlSchemaParser method setCurrentImports.
private void setCurrentImports(ImportDeclarationsContext imports) {
Map<String, Name> importsBySimpleName = new HashMap<>();
for (ImportDeclarationContext importDecl : imports.importDeclaration()) {
String importedFullname = importDecl.type.value;
Name importedName = new Name(importedFullname);
String importedSimpleName = importedName.getName();
if (importsBySimpleName.containsKey(importedSimpleName)) {
startErrorMessage(importDecl).append("'").append(importsBySimpleName.get(importedSimpleName)).append("' is already defined in an import.").append(NEWLINE);
}
importsBySimpleName.put(importedSimpleName, importedName);
}
this.currentImports = importsBySimpleName;
}
Aggregations