Package com.google.dart.engine.source

Examples of com.google.dart.engine.source.FileBasedSource


    for (SdkLibrary library : libraryMap.getSdkLibraries()) {
      String libraryPath = library.getPath();
      if (filePath.replace('\\', '/').equals(libraryPath)) {
        String path = library.getShortName();
        try {
          return new FileBasedSource(new URI(path), file);
        } catch (URISyntaxException exception) {
          AnalysisEngine.getInstance().getLogger().logInformation(
              "Failed to create URI: " + path,
              exception);
          return null;
        }
      }
      libraryPath = new File(libraryPath).getParent();
      if (filePath.startsWith(libraryPath + File.separator)) {
        String path = library.getShortName() + "/" + filePath.substring(libraryPath.length() + 1);
        try {
          return new FileBasedSource(new URI(path), file);
        } catch (URISyntaxException exception) {
          AnalysisEngine.getInstance().getLogger().logInformation(
              "Failed to create URI: " + path,
              exception);
          return null;
View Full Code Here


      File file = new File(getLibraryDirectory(), library.getPath());
      if (!relativePath.isEmpty()) {
        file = file.getParentFile();
        file = new File(file, relativePath);
      }
      return new FileBasedSource(new URI(dartUri), file);
    } catch (URISyntaxException exception) {
      return null;
    }
  }
View Full Code Here

   * @param file the {@link File} of the library file
   * @param libraryFileContents the contents from the library file
   * @return the library map read from the given source
   */
  public LibraryMap readFromFile(File file, String libraryFileContents) {
    return readFromSource(new FileBasedSource(file), libraryFileContents);
  }
View Full Code Here

TOP

Related Classes of com.google.dart.engine.source.FileBasedSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.