Package com.google.dart.engine.internal.cache

Examples of com.google.dart.engine.internal.cache.SourceEntry


     * @param librarySource the source of the library's defining compilation unit
     * @return the library object that was created
     */
    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


     * @param librarySource the source of the library's defining compilation unit
     * @return the library object that was created
     */
    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

                oldLength,
                newLength,
                getReadableSourceEntry(source));
          }
          sourceChanged(source);
          SourceEntry sourceEntry = cache.get(source);
          if (sourceEntry != null) {
            SourceEntryImpl sourceCopy = sourceEntry.getWritableCopy();
            sourceCopy.setModificationTime(contentCache.getModificationStamp(source));
            sourceCopy.setValue(SourceEntry.CONTENT, contents);
            cache.put(source, sourceCopy);
          }
        }
View Full Code Here

        if (!contents.equals(originalContents)) {
          incrementalAnalysisCache = IncrementalAnalysisCache.clear(
              incrementalAnalysisCache,
              source);
          sourceChanged(source);
          SourceEntry sourceEntry = cache.get(source);
          if (sourceEntry != null) {
            SourceEntryImpl sourceCopy = sourceEntry.getWritableCopy();
            sourceCopy.setModificationTime(contentCache.getModificationStamp(source));
            sourceCopy.setValue(SourceEntry.CONTENT, contents);
            cache.put(source, sourceCopy);
          }
        }
View Full Code Here

        }
      }
      if (neededForResolution != null) {
        ArrayList<Source> sourcesToRemove = new ArrayList<Source>();
        for (Source source : neededForResolution) {
          SourceEntry sourceEntry = cache.get(source);
          if (sourceEntry instanceof DartEntry) {
            DartEntry dartEntry = (DartEntry) sourceEntry;
            if (!dartEntry.hasResolvableCompilationUnit()) {
              if (dartEntry.getState(DartEntry.PARSED_UNIT) == CacheState.ERROR) {
                sourcesToRemove.add(source);
View Full Code Here

        }
      }

      Source[] librariesContaining = dartEntry.getValue(DartEntry.CONTAINING_LIBRARIES);
      for (Source librarySource : librariesContaining) {
        SourceEntry librarySourceEntry = cache.get(librarySource);
        if (librarySourceEntry instanceof DartEntry) {
          DartEntry libraryEntry = (DartEntry) librarySourceEntry;
          CacheState elementState = libraryEntry.getState(DartEntry.ELEMENT);
          if (elementState == CacheState.INVALID
              || (isPriority && elementState == CacheState.FLUSHED)) {
View Full Code Here

   * @param source the source for which a cache entry is being sought
   * @return the source cache entry associated with the given source
   */
  private DartEntry getReadableDartEntry(Source source) {
    synchronized (cacheLock) {
      SourceEntry sourceEntry = cache.get(source);
      if (sourceEntry == null) {
        sourceEntry = createSourceEntry(source, false);
      }
      if (sourceEntry instanceof DartEntry) {
        return (DartEntry) sourceEntry;
View Full Code Here

   * @param source the source for which a cache entry is being sought
   * @return the source cache entry associated with the given source
   */
  private HtmlEntry getReadableHtmlEntry(Source source) {
    synchronized (cacheLock) {
      SourceEntry sourceEntry = cache.get(source);
      if (sourceEntry == null) {
        sourceEntry = createSourceEntry(source, false);
      }
      if (sourceEntry instanceof HtmlEntry) {
        return (HtmlEntry) sourceEntry;
View Full Code Here

   * @param source the source for which a cache entry is being sought
   * @return the source cache entry associated with the given source
   */
  private SourceEntry getReadableSourceEntry(Source source) {
    synchronized (cacheLock) {
      SourceEntry sourceEntry = cache.get(source);
      if (sourceEntry == null) {
        sourceEntry = createSourceEntry(source, false);
      }
      return sourceEntry;
    }
View Full Code Here

   * @param librarySource the source representing the library containing the unit
   * @return the specified resolved compilation unit
   */
  private TimestampedData<CompilationUnit> getResolvedUnit(CompilationUnitElement element,
      Source librarySource) {
    SourceEntry sourceEntry = cache.get(element.getSource());
    if (sourceEntry instanceof DartEntry) {
      DartEntry dartEntry = (DartEntry) sourceEntry;
      if (dartEntry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource) == CacheState.VALID) {
        return new TimestampedData<CompilationUnit>(
            dartEntry.getModificationTime(),
View Full Code Here

TOP

Related Classes of com.google.dart.engine.internal.cache.SourceEntry

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.