Examples of AngularApplication


Examples of com.google.dart.engine.internal.element.angular.AngularApplication

  @Override
  public AngularApplication getAngularApplicationWithHtml(Source htmlSource) {
    SourceEntry sourceEntry = getReadableSourceEntryOrNull(htmlSource);
    if (sourceEntry instanceof HtmlEntry) {
      HtmlEntry htmlEntry = (HtmlEntry) sourceEntry;
      AngularApplication application = htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
      if (application != null) {
        return application;
      }
      return htmlEntry.getValue(HtmlEntry.ANGULAR_ENTRY);
    }
View Full Code Here

Examples of com.google.dart.engine.internal.element.angular.AngularApplication

   */
  private TaskData createResolveAngularComponentTemplateTask(Source source, HtmlEntry htmlEntry) {
    if (htmlEntry.getState(HtmlEntry.RESOLVED_UNIT) != CacheState.VALID) {
      return createResolveHtmlTask(source, htmlEntry);
    }
    AngularApplication application = htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
    AngularComponentElement component = htmlEntry.getValue(HtmlEntry.ANGULAR_COMPONENT);
    HtmlEntryImpl htmlCopy = htmlEntry.getWritableCopy();
    htmlCopy.setState(HtmlEntry.ANGULAR_ERRORS, CacheState.IN_PROCESS);
    cache.put(source, htmlCopy);
    return new TaskData(new ResolveAngularComponentTemplateTask(
View Full Code Here

Examples of com.google.dart.engine.internal.element.angular.AngularApplication

      // Angular
      if (options.getAnalyzeAngular()) {
        CacheState angularErrorsState = htmlEntry.getState(HtmlEntry.ANGULAR_ERRORS);
        if (angularErrorsState == CacheState.INVALID
            || (isPriority && angularErrorsState == CacheState.FLUSHED)) {
          AngularApplication entryInfo = htmlEntry.getValue(HtmlEntry.ANGULAR_ENTRY);
          if (entryInfo != null) {
            sources.add(source);
            return;
          }
          AngularApplication applicationInfo = htmlEntry.getValue(HtmlEntry.ANGULAR_APPLICATION);
          if (applicationInfo != null) {
            AngularComponentElement component = htmlEntry.getValue(HtmlEntry.ANGULAR_COMPONENT);
            if (component != null) {
              sources.add(source);
              return;
View Full Code Here

Examples of com.google.dart.engine.internal.element.angular.AngularApplication

   * re-accessed after this method returns.
   *
   * @param entryCopy the {@link HtmlEntryImpl} of the (maybe) Angular entry point being invalidated
   */
  private void invalidateAngularResolution(HtmlEntryImpl entryCopy) {
    AngularApplication application = entryCopy.getValue(HtmlEntry.ANGULAR_ENTRY);
    if (application == null) {
      return;
    }
    angularApplications.remove(application);
    // invalidate Entry
    entryCopy.setState(HtmlEntry.ANGULAR_ENTRY, CacheState.INVALID);
    // reset HTML sources
    AngularElement[] oldAngularElements = application.getElements();
    for (AngularElement angularElement : oldAngularElements) {
      if (angularElement instanceof AngularHasTemplateElement) {
        AngularHasTemplateElement hasTemplate = (AngularHasTemplateElement) angularElement;
        Source templateSource = hasTemplate.getTemplateSource();
        if (templateSource != null) {
          HtmlEntry htmlEntry = getReadableHtmlEntry(templateSource);
          HtmlEntryImpl htmlCopy = htmlEntry.getWritableCopy();
          htmlCopy.setValue(HtmlEntry.ANGULAR_APPLICATION, null);
          htmlCopy.setValue(HtmlEntry.ANGULAR_COMPONENT, null);
          htmlCopy.setState(HtmlEntry.ANGULAR_ERRORS, CacheState.INVALID);
          cache.put(templateSource, htmlCopy);
          workManager.add(templateSource, SourcePriority.HTML);
        }
      }
    }
    // reset Dart sources
    Source[] oldElementSources = application.getElementSources();
    for (Source elementSource : oldElementSources) {
      DartEntry dartEntry = getReadableDartEntry(elementSource);
      DartEntryImpl dartCopy = dartEntry.getWritableCopy();
      dartCopy.setValue(DartEntry.ANGULAR_ERRORS, AnalysisError.NO_ERRORS);
      cache.put(elementSource, dartCopy);
View Full Code Here

Examples of com.google.dart.engine.internal.element.angular.AngularApplication

   * Updates {@link HtmlEntry}s that correspond to the previously known and new Angular application
   * information.
   */
  private void recordAngularEntryPoint(HtmlEntryImpl entry, ResolveAngularEntryHtmlTask task)
      throws AnalysisException {
    AngularApplication application = task.getApplication();
    if (application != null) {
      angularApplications.add(application);
      // if this is an entry point, then we already resolved it
      entry.setValue(HtmlEntry.ANGULAR_ERRORS, task.getEntryErrors());
      // schedule HTML templates analysis
      AngularElement[] newAngularElements = application.getElements();
      for (AngularElement angularElement : newAngularElements) {
        if (angularElement instanceof AngularHasTemplateElement) {
          AngularHasTemplateElement hasTemplate = (AngularHasTemplateElement) angularElement;
          Source templateSource = hasTemplate.getTemplateSource();
          if (templateSource != null) {
            HtmlEntry htmlEntry = getReadableHtmlEntry(templateSource);
            HtmlEntryImpl htmlCopy = htmlEntry.getWritableCopy();
            htmlCopy.setValue(HtmlEntry.ANGULAR_APPLICATION, application);
            if (hasTemplate instanceof AngularComponentElement) {
              AngularComponentElement component = (AngularComponentElement) hasTemplate;
              htmlCopy.setValue(HtmlEntry.ANGULAR_COMPONENT, component);
            }
            htmlCopy.setState(HtmlEntry.ANGULAR_ERRORS, CacheState.INVALID);
            cache.put(templateSource, htmlCopy);
            workManager.add(templateSource, SourcePriority.HTML);
          }
        }
      }
      // update Dart sources errors
      Source[] newElementSources = application.getElementSources();
      for (Source elementSource : newElementSources) {
        DartEntry dartEntry = getReadableDartEntry(elementSource);
        DartEntryImpl dartCopy = dartEntry.getWritableCopy();
        dartCopy.setValue(DartEntry.ANGULAR_ERRORS, task.getErrors(elementSource));
        cache.put(elementSource, dartCopy);
View Full Code Here

Examples of com.google.dart.engine.internal.element.angular.AngularApplication

              templateUri));
        }
      }
    }
    // create AngularApplication
    AngularApplication application = new AngularApplication(
        source,
        getLibrarySources(libraries),
        angularElements,
        angularElementsSources.toArray(new Source[angularElementsSources.size()]));
    // set AngularApplication for each AngularElement
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.