Package com.google.dart.engine.internal.element

Examples of com.google.dart.engine.internal.element.LibraryElementImpl


     */
    private ResolvableLibrary createLibrary(Source librarySource) {
      ResolvableLibrary library = new ResolvableLibrary(librarySource);
      SourceEntry sourceEntry = cache.get(librarySource);
      if (sourceEntry instanceof DartEntry) {
        LibraryElementImpl libraryElement = (LibraryElementImpl) sourceEntry.getValue(DartEntry.ELEMENT);
        if (libraryElement != null) {
          library.setLibraryElement(libraryElement);
        }
      }
      libraryMap.put(librarySource, library);
View Full Code Here


     */
    private ResolvableLibrary createLibraryOrNull(Source librarySource) {
      ResolvableLibrary library = new ResolvableLibrary(librarySource);
      SourceEntry sourceEntry = cache.get(librarySource);
      if (sourceEntry instanceof DartEntry) {
        LibraryElementImpl libraryElement = (LibraryElementImpl) sourceEntry.getValue(DartEntry.ELEMENT);
        if (libraryElement != null) {
          library.setLibraryElement(libraryElement);
        }
      }
      libraryMap.put(librarySource, library);
View Full Code Here

      String scriptSourcePath = scriptAttribute == null ? null : scriptAttribute.getText();
      if (node.getAttributeEnd().getType() == TokenType.GT && scriptSourcePath == null) {
        EmbeddedHtmlScriptElementImpl script = new EmbeddedHtmlScriptElementImpl(node);
        try {
          LibraryResolver resolver = new LibraryResolver(context);
          LibraryElementImpl library = (LibraryElementImpl) resolver.resolveEmbeddedLibrary(
              htmlSource,
              modificationStamp,
              node.getScript(),
              true);
          script.setScriptLibrary(library);
View Full Code Here

    // create CompilationUnitElementImpl
    String unitName = source.getShortName();
    unitElement = new CompilationUnitElementImpl(unitName);
    unitElement.setSource(source);
    // create LibraryElementImpl
    libraryElement = new LibraryElementImpl(context.getContextFor(source), null);
    libraryElement.setDefiningCompilationUnit(unitElement);
    libraryElement.setAngularHtml(true);
    injectedLibraries.add(libraryElement);
    // create FunctionElementImpl
    functionElement = new FunctionElementImpl(0);
View Full Code Here

        ImportElementImpl importElement = new ImportElementImpl(-1);
        importElement.setImportedLibrary(coreLibrary.getLibraryElement());
        importElement.setSynthetic(true);
        imports.add(importElement);
      }
      LibraryElementImpl libraryElement = library.getLibraryElement();
      libraryElement.setImports(imports.toArray(new ImportElement[imports.size()]));
      libraryElement.setExports(exports.toArray(new ExportElement[exports.size()]));
      if (libraryElement.getEntryPoint() == null) {
        Namespace namespace = new NamespaceBuilder().createExportNamespaceForLibrary(libraryElement);
        Element element = namespace.get(LibraryElementBuilder.ENTRY_POINT_NAME);
        if (element instanceof FunctionElement) {
          libraryElement.setEntryPoint((FunctionElement) element);
        }
      }
    }
  }
View Full Code Here

  private void buildElementModels() throws AnalysisException {
    for (ResolvableLibrary library : librariesInCycle) {
      LibraryElementBuilder builder = new LibraryElementBuilder(
          getAnalysisContext(),
          getErrorListener());
      LibraryElementImpl libraryElement = builder.buildLibrary(library);
      library.setLibraryElement(libraryElement);
    }
  }
View Full Code Here

        ImportElementImpl importElement = new ImportElementImpl(-1);
        importElement.setImportedLibrary(coreLibrary.getLibraryElement());
        importElement.setSynthetic(true);
        imports.add(importElement);
      }
      LibraryElementImpl libraryElement = library.getLibraryElement();
      libraryElement.setImports(imports.toArray(new ImportElement[imports.size()]));
      libraryElement.setExports(exports.toArray(new ExportElement[exports.size()]));
      if (libraryElement.getEntryPoint() == null) {
        Namespace namespace = new NamespaceBuilder().createExportNamespaceForLibrary(libraryElement);
        Element element = namespace.get(LibraryElementBuilder.ENTRY_POINT_NAME);
        if (element instanceof FunctionElement) {
          libraryElement.setEntryPoint((FunctionElement) element);
        }
      }
    }
  }
View Full Code Here

  private void buildElementModels() throws AnalysisException {
    for (Library library : librariesInCycles) {
      LibraryElementBuilder builder = new LibraryElementBuilder(
          getAnalysisContext(),
          getErrorListener());
      LibraryElementImpl libraryElement = builder.buildLibrary(library);
      library.setLibraryElement(libraryElement);
    }
  }
View Full Code Here

          ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART));
    }
    //
    // Create and populate the library element.
    //
    LibraryElementImpl libraryElement = new LibraryElementImpl(
        analysisContext.getContextFor(librarySource),
        libraryNameNode);
    libraryElement.setDefiningCompilationUnit(definingCompilationUnitElement);
    if (entryPoint != null) {
      libraryElement.setEntryPoint(entryPoint);
    }
    int sourcedUnitCount = sourcedCompilationUnits.size();
    libraryElement.setParts(sourcedCompilationUnits.toArray(new CompilationUnitElementImpl[sourcedUnitCount]));
    for (Directive directive : directivesToResolve) {
      directive.setElement(libraryElement);
    }
    library.setLibraryElement(libraryElement);
    if (sourcedUnitCount > 0) {
View Full Code Here

          ResolverErrorCode.MISSING_LIBRARY_DIRECTIVE_WITH_PART));
    }
    //
    // Create and populate the library element.
    //
    LibraryElementImpl libraryElement = new LibraryElementImpl(
        analysisContext.getContextFor(librarySource),
        libraryNameNode);
    libraryElement.setDefiningCompilationUnit(definingCompilationUnitElement);
    if (entryPoint != null) {
      libraryElement.setEntryPoint(entryPoint);
    }
    int sourcedUnitCount = sourcedCompilationUnits.size();
    libraryElement.setParts(sourcedCompilationUnits.toArray(new CompilationUnitElementImpl[sourcedUnitCount]));
    for (Directive directive : directivesToResolve) {
      directive.setElement(libraryElement);
    }
    library.setLibraryElement(libraryElement);
    if (sourcedUnitCount > 0) {
View Full Code Here

TOP

Related Classes of com.google.dart.engine.internal.element.LibraryElementImpl

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.