public class ProjectFileProvider extends CachedFileProvider
ProjectFileProvider
is an implementation of the
JavaFileProvider
interface which relies on the
path information of a Project
for locating Java source and class
files. This implementation will respond to changes in the project paths by
updating its class locator, and flushing its cache.CachedFileProvider.SourceFileTracker
BaseFileProvider.BaseClass, BaseFileProvider.BasePackage
Modifier and Type | Field and Description |
---|---|
protected oracle.jdeveloper.java.provider.ProjectFileProvider.ProjectObserver |
_projectObserver
Our observer for tracking changes to the project.
|
_arrayCacheMap, _cacheLock, _cacheRefCount, _classCacheMap, _classFileCacheMap, _defaultClassLoader, _lastCacheFlushedTime, _lightSourceFileCacheMap, _nullClassLoader, _packageCacheMap, _sourceFileCacheMap, CLASS_NOT_FOUND
context
CLASS_TYPE, EMPTY_COLLECTION, SOURCE_TYPE, UNKNOWN_TYPE
Constructor and Description |
---|
ProjectFileProvider(ProviderContext e,
Project project)
Constructs a new
ProjectFileProvider instance using
the given project to locate Java source and class files. |
ProjectFileProvider(ProviderContext e,
Project project,
java.util.Map cache) |
Modifier and Type | Method and Description |
---|---|
JavaClassLocator |
getClassLocator()
Fetch the class locator to use for locating files.
|
JavaClassLocator |
getClassLocatorInterruptibly()
Get the class locator for this provider.
|
static ProjectFileProvider |
getInstance(Project project)
Deprecated.
|
static ProjectFileProvider |
getInstance(Project project,
java.lang.Object key)
Deprecated.
|
static ProjectFileProvider |
getInstance(Workspace workspace,
Project project)
Static factory method for fetching an instance of
ProjectFileProvider for the given project. |
static ProjectFileProvider |
getInstance(Workspace workspace,
Project project,
java.lang.Object key)
Static factory method for fetching an instance of
ProjectFileProvider for the given project. |
SourceClass |
getProjectSourceClass(java.lang.String fqClassName)
Fetch the SourceClass instance for the given fully-qualified class
name.
|
protected void |
handleProjectClose()
Utility routine to handle any necessary cleanup when the project
closes.
|
protected void |
handleProjectContentsChange()
Utility routine to handle a change in the contents of the project
(i.e., class added or removed.)
|
protected void |
handleProjectLoad()
Utility routine to handle any necessary setup or cleanup when the
project is opened or reopened (revert).
|
void |
handleProjectPathsChange()
Utility routine to handle a change in the paths of the project
|
protected boolean |
isProjectSourceURL(java.net.URL sourceURL)
Fetch whether this source URL is part of the project's source path
(including project dependencies).
|
protected static boolean |
pathContainsURL(URLPath path,
java.net.URL url)
Utility to check whether the specified URL is present in one of the
directories specified by URLPath.
|
void |
reloadClassLocator()
Force the class locator to be reloaded.
|
beginCacheUse, clearAllData, clearArrayCache, clearClassCache, clearClassFileCache, clearClassLoader, clearCompiledInfo, clearLightSourceFileCache, clearPackageCache, clearSourceFileCache, createSourceFile, endCacheUse, expireAllSourceFiles, flushCache, flushFoundCache, getArrayTypeImpl, getClassExactImpl, getClassExactImplInterruptibly, getClassFileImpl, getClassLoader, getClassLoader, getLightSourceFileImpl, getPackageImpl, getScopeDescription, getSourceFileImpl, lastCacheFlushed, lookupCachedLightSourceFile, lookupCachedSourceFile, notifyOfChange, removeCachedLightSourceFile, removeCachedSourceFile, removeCachedSourceFile, storeCachedLightSourceFile, storeCachedSourceFile
checkInterrupt, getArrayType, getClass, getClass, getClassByVMName, getClassByVMNameImpl, getClassByVMNameInterruptibly, getClassImpl, getClassImpl, getClassInterruptibly, getClassInterruptibly, getClassLeftToRight, getClassLeftToRightImpl, getClassLeftToRightInterruptibly, getConteXt, getFile, getFileType, getInnerClassByVMName, getJavaFile, getJdkVersion, getPackage, getPackage, getPrimitiveClass, getSourceClass, getSourceClassByHint, getSourceClassImpl, getSourceClassInterruptibly, getSourceFile, getSourceFile, getTargetJdkVersion, getTextBuffer, locateClass, locateClass, locateClassByVMName, locateSourceClass, locateSourceClass, setConteXt, setJdkVersion, setTargetJdkVersion
protected final oracle.jdeveloper.java.provider.ProjectFileProvider.ProjectObserver _projectObserver
public ProjectFileProvider(ProviderContext e, Project project)
ProjectFileProvider
instance using
the given project to locate Java source and class files.project
- the project to usepublic ProjectFileProvider(ProviderContext e, Project project, java.util.Map cache)
public static ProjectFileProvider getInstance(Workspace workspace, Project project)
ProjectFileProvider
for the given project.workspace
- the workspaceproject
- the project to use for locating filespublic static ProjectFileProvider getInstance(Workspace workspace, Project project, java.lang.Object key)
ProjectFileProvider
for the given project.workspace
- the workspaceproject
- the project to use for locating fileskey
- the key used to look up the provider@Deprecated public static ProjectFileProvider getInstance(Project project)
getInstance(Workspace,Project)
.JavaFileProvider
for the given project.project
- the project to use for locating files@Deprecated public static ProjectFileProvider getInstance(Project project, java.lang.Object key)
getInstance(Workspace,Project,Object)
.JavaFileProvider
for the given project.project
- the project to use for locating filesprotected void handleProjectClose()
protected void handleProjectLoad()
public void handleProjectPathsChange()
protected void handleProjectContentsChange()
public JavaClassLocator getClassLocator()
getClassLocator
in class BaseFileProvider
public JavaClassLocator getClassLocatorInterruptibly() throws java.lang.InterruptedException
BaseFileProvider
getClassLocatorInterruptibly
in class BaseFileProvider
java.lang.InterruptedException
- if the calling thread is interrupted while
the locator is being createdpublic void reloadClassLocator()
public SourceClass getProjectSourceClass(java.lang.String fqClassName)
fqClassName
- the fully-qualified class name in dotted notation,
such as "java.lang.Object" or "java.util.Map.Entry"protected boolean isProjectSourceURL(java.net.URL sourceURL)
protected static boolean pathContainsURL(URLPath path, java.net.URL url)