Example #1
0
 @Override
 public LibrarySource getImportFor(String relPath) {
   for (LibrarySource lib : imports) {
     if (lib.getName().equals(relPath)) {
       return lib;
     }
   }
   return null;
 }
Example #2
0
 @Override
 public Reader getSourceReader() {
   ArrayList<String> libNames = new ArrayList<String>();
   for (LibrarySource lib : imports) {
     libNames.add(lib.getName());
   }
   ArrayList<String> sourceNames = new ArrayList<String>();
   for (DartSource source : sources) {
     sourceNames.add(source.getName());
   }
   // Passing null for the entryPoint, assuming the source already contains a
   // toplevel main() or is a library that doesn't require an entryPoint.
   return new StringReader(
       DefaultLibrarySource.generateSource(getName(), libNames, sourceNames, null));
 }