public class LibraryGroupUnitCache extends Object implements UnitCache
Constructor and Description |
---|
LibraryGroupUnitCache(LibraryGroup libraryGroup) |
Modifier and Type | Method and Description |
---|---|
void |
add(CompilationUnit compilationUnit)
Adds a
CompilationUnit to the cache.Though this class is intended primarily to expose and cache compilation units from previously compiled library files it must also be prepared to accept brand new compilation units resulting from live compilation as this is an absolute requirement for the current compiler design. |
void |
addArchivedUnit(CompilationUnit compilationUnit)
Adds a new entry into the cache, but marks it as already coming from a
persistent archive.
|
void |
cleanup(TreeLogger logger)
Each run of the compiler should call
UnitCache.cleanup(TreeLogger) when
finished adding units to the cache so that cache files from previous runs
can be purged from a persistent cache. |
CompilationUnit |
find(com.google.gwt.dev.javac.ContentId contentId)
Finds and returns the compilation unit for the type name referenced in the provided ContentId.
|
CompilationUnit |
find(String resourcePath)
Lookup a
CompilationUnit by resource path. |
void |
remove(CompilationUnit unit)
Remove a
CompilationUnit from the cache. |
static String |
typeSourceNameToResourcePath(String typeName)
Translates type names to resource paths to ease lookups since the unit cache system caches
based on resource path but the natural mode of interaction with this cache is via type names.
|
public LibraryGroupUnitCache(LibraryGroup libraryGroup)
public static String typeSourceNameToResourcePath(String typeName)
public void add(CompilationUnit compilationUnit)
CompilationUnit
to the cache.public void addArchivedUnit(CompilationUnit compilationUnit)
UnitCache
addArchivedUnit
in interface UnitCache
public void cleanup(TreeLogger logger)
UnitCache
UnitCache.cleanup(TreeLogger)
when
finished adding units to the cache so that cache files from previous runs
can be purged from a persistent cache.public CompilationUnit find(com.google.gwt.dev.javac.ContentId contentId)
public CompilationUnit find(String resourcePath)
UnitCache
CompilationUnit
by resource path. This should include any path prefix that may
have been stripped to reroot the resource.find
in interface UnitCache
CompilationUnit.getResourcePath()
public void remove(CompilationUnit unit)
UnitCache
CompilationUnit
from the cache.Copyright © 2018. All rights reserved.