Klasse JavaModelManager
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.JavaModelManager
- Alle implementierten Schnittstellen:
EventListener
,org.eclipse.core.resources.ISaveParticipant
,org.eclipse.core.runtime.content.IContentTypeManager.IContentTypeChangeListener
public class JavaModelManager
extends Object
implements org.eclipse.core.resources.ISaveParticipant, org.eclipse.core.runtime.content.IContentTypeManager.IContentTypeChangeListener
The
JavaModelManager
manages instances of IJavaModel
.
IElementChangedListener
s register with the JavaModelManager
,
and receive ElementChangedEvent
s for all IJavaModel
s.
The single instance of JavaModelManager
is available from
the static method JavaModelManager.getJavaModelManager()
.
-
Verschachtelte Klassen - Übersicht
Modifizierer und TypKlasseBeschreibungstatic enum
static class
static class
Update the classpath variable cachestatic class
static class
-
Feldübersicht
Modifizierer und TypFeldBeschreibungstatic final String
Name of the extension point for contributing the Java 6 annotation processor managerstatic final int
static final int
int
static final String
Name of the extension point for contributing a compilation participantstatic final String
static final IClasspathContainer
static final String
HashMap
<IJavaProject, Map<org.eclipse.core.runtime.IPath, IClasspathContainer>> Classpath containers poolstatic final String
static final String
static final org.eclipse.core.runtime.IPath
static boolean
static boolean
static boolean
static final String
static final String
static final String
Name of the extension point for contributing classpath container initializersstatic final String
Name of the extension point for contributing classpath variable initializersstatic boolean
static boolean
static final String
Holds the state used for delta processing.Set of elements which are out of sync with their buffers.static final String
Name of the extension point for contributing a source code formatterstatic boolean
static final String
Name of the JVM parameter to specify how many compilation units must be handled at once by the builder.static final int
static final int
static final ICompilationUnit[]
static boolean
static boolean
protected Map
<org.eclipse.core.resources.IProject, JavaModelManager.PerProjectInfo> Table from IProject to PerProjectInfo.Table from WorkingCopyOwner to a table of ICompilationUnit (working copy handle) to PerWorkingCopyInfo.final org.eclipse.core.runtime.preferences.IEclipsePreferences[]
HashMap
<IJavaProject, Map<org.eclipse.core.runtime.IPath, IClasspathContainer>> static final String
protected WeakHashMap
<AbstractSearchScope, ?> A weak set of the known search scopes.static final String
static boolean
For use in the JDT unit tests only.static final String
static final org.eclipse.core.runtime.IPath
Special value used for recognizing ongoing initialization and breaking initialization cyclesstatic final String
Classpath variables poolstatic boolean
static boolean
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
addAssumedExternalFile
(org.eclipse.core.runtime.IPath path) Adds the providedIPath
to the list of assumed external files.void
addExternalFile
(org.eclipse.core.runtime.IPath path) Adds a path to the external files cache.void
addInvalidArchive
(org.eclipse.core.runtime.IPath path, JavaModelManager.ArchiveValidity reason) void
addNonChainingJar
(org.eclipse.core.runtime.IPath path) cacheToString
(String prefix) void
cacheZipFiles
(Object owner) Starts caching ZipFiles.void
clearExternalFileState
(org.eclipse.core.runtime.IPath path) Removes the cached state of a single entry in the externalFiles cache.void
closeZipFile
(ZipFile zipFile) static boolean
conflictsWithOutputLocation
(org.eclipse.core.runtime.IPath folderPath, JavaProject project) Returns whether the given full path (for a package) conflicts with the output location of the given project.containerBeingInitializedGet
(IJavaProject project, org.eclipse.core.runtime.IPath containerPath) void
containerBeingInitializedPut
(IJavaProject project, org.eclipse.core.runtime.IPath containerPath, IClasspathContainer container) containerBeingInitializedRemove
(IJavaProject project, org.eclipse.core.runtime.IPath containerPath) containerGet
(IJavaProject project, org.eclipse.core.runtime.IPath containerPath) containerGetDefaultToPreviousSession
(IJavaProject project, org.eclipse.core.runtime.IPath containerPath) void
containerPut
(IJavaProject project, org.eclipse.core.runtime.IPath containerPath, IClasspathContainer container) boolean
containerPutIfInitializingWithSameEntries
(org.eclipse.core.runtime.IPath containerPath, IJavaProject[] projects, IClasspathContainer[] respectiveContainers) void
containerRemove
(IJavaProject project) void
contentTypeChanged
(org.eclipse.core.runtime.content.IContentTypeManager.ContentTypeChangeEvent event) static IJavaElement
create
(org.eclipse.core.resources.IFile file, IJavaProject project) Returns the Java element corresponding to the given file, its project being the given project.static IJavaElement
create
(org.eclipse.core.resources.IFolder folder, IJavaProject project) Returns the package fragment or package fragment root corresponding to the given folder, its parent or great parent being the given project.static IJavaElement
create
(org.eclipse.core.resources.IResource resource, IJavaProject project) Returns the Java element corresponding to the given resource, ornull
if unable to associate the given resource with a Java element.static IClassFile
createClassFileFrom
(org.eclipse.core.resources.IFile file, IJavaProject project) Creates and returns a class file element for the given.class
file, its project being the given project.static ICompilationUnit
createCompilationUnitFrom
(org.eclipse.core.resources.IFile file, IJavaProject project) Creates and returns a compilation unit element for the given.java
file, its project being the given project.static IPackageFragmentRoot
createJarPackageFragmentRootFrom
(org.eclipse.core.resources.IFile file, IJavaProject project) Creates and returns a handle for the given JAR file, its project being the given project.static IJavaElement
determineIfOnClasspath
(org.eclipse.core.resources.IResource resource, IJavaProject project) Returns the package fragment root represented by the resource, or the package fragment the given resource is located in, ornull
if the given resource is not on the classpath of the given project.int
discardPerWorkingCopyInfo
(CompilationUnit workingCopy) void
doneSaving
(org.eclipse.core.resources.ISaveContext context) static final void
doNotUse()
void
flushZipFiles
(Object owner) Flushes ZipFiles cache if there are no more clients.boolean
forceBatchInitializations
(boolean initAfterLoad) getAccessRule
(org.eclipse.core.runtime.IPath filePattern, int kind) Get a cached access rule, or when the cache did not contain the rule, creates a new one.getAccessRuleForProblemId
(char[] filePattern, int problemId) Used only for loading rules from disk.getArchiveValidity
(org.eclipse.core.runtime.IPath path) getClasspathContainer
(org.eclipse.core.runtime.IPath containerPath, IJavaProject project) org.eclipse.core.runtime.preferences.IEclipsePreferences
Get default eclipse preference for JavaCore plugin.static DeltaProcessingState
Returns the set of elements which are out of synch with their buffers.getExistingElement
(IJavaElement element) Returns the existing element in the cache that is equal to the given element.static ExternalFoldersManager
static IndexManager
getInfo
(IJavaElement element) Returns the info for the element.org.eclipse.core.runtime.preferences.IEclipsePreferences
Get workspace eclipse preference for JavaCore plug-in.final JavaModel
Returns the handle to the active Java Model.static final JavaModelManager
Returns the singleton JavaModelManagergetLastBuiltState
(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IProgressMonitor monitor) Returns the last built state for the given project, or null if there is none.static File
getLocalFile
(org.eclipse.core.runtime.IPath path) static ModuleSourcePathManager
int
getOption
(String optionName, boolean inheritJavaCoreOptions, org.eclipse.core.runtime.preferences.IEclipsePreferences projectPreferences) Returns the value of the given option for the given Eclipse preferences.int
getOptionLevel
(String optionName) Returns the level of the given option.getPerProjectInfo
(org.eclipse.core.resources.IProject project, boolean create) getPerProjectInfoCheckExistence
(org.eclipse.core.resources.IProject project) getPerWorkingCopyInfo
(CompilationUnit workingCopy, boolean create, boolean recordUsage, IProblemRequestor problemRequestor) getPreviousSessionContainer
(org.eclipse.core.runtime.IPath containerPath, IJavaProject project) Returns a persisted container from previous session if any.org.eclipse.core.runtime.IPath
getPreviousSessionVariable
(String variableName) Returns a persisted container from previous session if anygetReferencedClasspathEntries
(IClasspathEntry libraryEntry, IJavaProject project) static String[]
Returns the name of the container IDs for which an CP container initializer is registered through an extension pointstatic String[]
Returns the name of the variables for which an CP variable initializer is registered through an extension pointorg.eclipse.core.runtime.IPath
getResolvedVariablePath
(org.eclipse.core.runtime.IPath variablePath, boolean usePreviousSession) Returns the temporary cache for newly opened elements for the current thread.static UserLibraryManager
getWorkingCopies
(WorkingCopyOwner owner, boolean addPrimary) getZipFile
(org.eclipse.core.runtime.IPath path) Returns the open ZipFile at the given path.getZipFile
(org.eclipse.core.runtime.IPath path, boolean checkInvalidArchiveCache) boolean
void
Initialize preferences lookups for JavaCore plug-in.char[]
intern
(char[] array) boolean
isAssumedExternalFile
(org.eclipse.core.runtime.IPath path) Returns whether the providedIPath
appears to be an external file, which is true if the path does not represent an internal resource, does not exist on the file system, and does have a file extension (this is the definition provided byExternalFoldersManager.isExternalFolderPath(org.eclipse.core.runtime.IPath)
).boolean
isClasspathBeingResolved
(IJavaProject project) boolean
isExternalFile
(org.eclipse.core.runtime.IPath path) Returns the cached value for whether the file referred to bypath
exists and is a file, as determined by the return value ofFile.isFile()
.static boolean
static boolean
isJrt
(org.eclipse.core.runtime.IPath path) boolean
isNonChainingJar
(org.eclipse.core.runtime.IPath path) boolean
knowsOption
(String optionName) Returns whether an option name is known or not.void
protected Object
peekAtInfo
(IJavaElement element) Returns the info for this element without disturbing the cache ordering.void
prepareToSave
(org.eclipse.core.resources.ISaveContext context) protected Object
putInfos
(IJavaElement openedElement, Object newInfo, boolean forceAdd, Map<IJavaElement, Object> newElements) protected void
putJarTypeInfo
(IJavaElement type, Object info) Remember the info for the jar binary typeprotected Object
readState
(org.eclipse.core.resources.IProject project) Reads the build state for the relevant project.static void
recreatePersistedContainer
(String propertyName, String containerString, boolean addToContainerValues) static void
registerDebugOptionsListener
(org.osgi.framework.BundleContext context) void
rememberScope
(AbstractSearchScope scope) Remembers the given scope in a weak set (so no need to remove it: it will be removed by the garbage collector)void
removeFromInvalidArchiveCache
(org.eclipse.core.runtime.IPath path) removeInfoAndChildren
(JavaElement element) void
removePerProjectInfo
(JavaProject javaProject, boolean removeExtJarInfo) void
void
Resets the entire externalFiles cache.protected void
void
resetProjectOptions
(JavaProject javaProject) void
resetProjectPreferences
(JavaProject javaProject) void
resolveVariableEntry
(IClasspathEntry entry, boolean usePreviousSession) void
rollback
(org.eclipse.core.resources.ISaveContext context) void
saving
(org.eclipse.core.resources.ISaveContext context) void
secondaryTypeAdding
(String path, char[] typeName, char[] packageName) Add a secondary type in temporary indexing cache for a project got from given path.secondaryTypes
(IJavaProject project, boolean waitForIndexes, org.eclipse.core.runtime.IProgressMonitor monitor) Get all secondary types for a project and store result in per project info cache.void
secondaryTypesRemoving
(org.eclipse.core.resources.IFile file, boolean cleanIndexCache) Remove from secondary types cache all types belonging to a given file.protected void
setBuildOrder
(String[] javaBuildOrder) Record the order in which to build the java projects (batch build).void
setClasspathBeingResolved
(IJavaProject project, boolean classpathIsResolved) void
setLastBuiltState
(org.eclipse.core.resources.IProject project, Object state) Sets the last built state for the given project, or null to reset it.void
setOptions
(Hashtable<String, String> newOptions) void
shutdown()
void
startup()
boolean
storePreference
(String optionName, String optionValue, org.eclipse.core.runtime.preferences.IEclipsePreferences eclipsePreferences, Map<String, String> otherOptions) Store the preferences value for the given option name.static void
static void
static void
static void
org.eclipse.core.runtime.IPath
variableGet
(String variableName) String[]
void
variablePreferencesPut
(String variableName, org.eclipse.core.runtime.IPath variablePath) void
variablePut
(String variableName, org.eclipse.core.runtime.IPath variablePath) boolean
variablePutIfInitializingWithSameValue
(String[] variableNames, org.eclipse.core.runtime.IPath[] variablePaths) void
verifyArchiveContent
(org.eclipse.core.runtime.IPath path)
-
Felddetails
-
variables
Classpath variables pool -
variablesWithInitializer
-
deprecatedVariables
-
readOnlyVariables
-
previousSessionVariables
-
containers
Classpath containers pool -
previousSessionContainers
public HashMap<IJavaProject,Map<org.eclipse.core.runtime.IPath, previousSessionContainersIClasspathContainer>> -
NO_BATCH_INITIALIZATION
public static final int NO_BATCH_INITIALIZATION- Siehe auch:
-
NEED_BATCH_INITIALIZATION
public static final int NEED_BATCH_INITIALIZATION- Siehe auch:
-
BATCH_INITIALIZATION_IN_PROGRESS
public static final int BATCH_INITIALIZATION_IN_PROGRESS- Siehe auch:
-
BATCH_INITIALIZATION_FINISHED
public static final int BATCH_INITIALIZATION_FINISHED- Siehe auch:
-
batchContainerInitializations
public int batchContainerInitializations -
batchContainerInitializationsLock
-
batchContainerInitializationsProgress
-
containerInitializersCache
-
workspaceScope
-
rootPathToAttachments
-
CP_VARIABLE_PREFERENCES_PREFIX
- Siehe auch:
-
CP_CONTAINER_PREFERENCES_PREFIX
- Siehe auch:
-
CP_USERLIBRARY_PREFERENCES_PREFIX
- Siehe auch:
-
CP_ENTRY_IGNORE
- Siehe auch:
-
CP_ENTRY_IGNORE_PATH
public static final org.eclipse.core.runtime.IPath CP_ENTRY_IGNORE_PATH -
TRUE
- Siehe auch:
-
CPVARIABLE_INITIALIZER_EXTPOINT_ID
Name of the extension point for contributing classpath variable initializers- Siehe auch:
-
CPCONTAINER_INITIALIZER_EXTPOINT_ID
Name of the extension point for contributing classpath container initializers- Siehe auch:
-
FORMATTER_EXTPOINT_ID
Name of the extension point for contributing a source code formatter- Siehe auch:
-
COMPILATION_PARTICIPANT_EXTPOINT_ID
Name of the extension point for contributing a compilation participant- Siehe auch:
-
ANNOTATION_PROCESSOR_MANAGER_EXTPOINT_ID
Name of the extension point for contributing the Java 6 annotation processor manager- Siehe auch:
-
MAX_COMPILED_UNITS_AT_ONCE
Name of the JVM parameter to specify how many compilation units must be handled at once by the builder. The default value is represented byAbstractImageBuilder#MAX_AT_ONCE
.- Siehe auch:
-
VARIABLE_INITIALIZATION_IN_PROGRESS
public static final org.eclipse.core.runtime.IPath VARIABLE_INITIALIZATION_IN_PROGRESSSpecial value used for recognizing ongoing initialization and breaking initialization cycles -
CONTAINER_INITIALIZATION_IN_PROGRESS
-
COMPLETION_PERF
- Siehe auch:
-
SELECTION_PERF
- Siehe auch:
-
DELTA_LISTENER_PERF
- Siehe auch:
-
VARIABLE_INITIALIZER_PERF
- Siehe auch:
-
CONTAINER_INITIALIZER_PERF
- Siehe auch:
-
RECONCILE_PERF
- Siehe auch:
-
PERF_VARIABLE_INITIALIZER
public static boolean PERF_VARIABLE_INITIALIZER -
PERF_CONTAINER_INITIALIZER
public static boolean PERF_CONTAINER_INITIALIZER -
NO_WORKING_COPY
-
preferencesLookup
public final org.eclipse.core.runtime.preferences.IEclipsePreferences[] preferencesLookup -
compilationParticipants
-
abortOnMissingSource
-
elementsOutOfSynchWithBuffers
Set of elements which are out of sync with their buffers. -
deltaState
Holds the state used for delta processing. -
indexManager
-
perProjectInfos
Table from IProject to PerProjectInfo. NOTE: this object itself is used as a lock to synchronize creation/removal of per project infos -
perWorkingCopyInfos
protected HashMap<WorkingCopyOwner,Map<CompilationUnit, perWorkingCopyInfosJavaModelManager.PerWorkingCopyInfo>> Table from WorkingCopyOwner to a table of ICompilationUnit (working copy handle) to PerWorkingCopyInfo. NOTE: this object itself is used as a lock to synchronize creation/removal of per working copy infos -
searchScopes
A weak set of the known search scopes. -
VERBOSE
public static boolean VERBOSE -
DEBUG_CLASSPATH
public static boolean DEBUG_CLASSPATH -
DEBUG_INVALID_ARCHIVES
public static boolean DEBUG_INVALID_ARCHIVES -
CP_RESOLVE_VERBOSE
public static boolean CP_RESOLVE_VERBOSE -
CP_RESOLVE_VERBOSE_ADVANCED
public static boolean CP_RESOLVE_VERBOSE_ADVANCED -
CP_RESOLVE_VERBOSE_FAILURE
public static boolean CP_RESOLVE_VERBOSE_FAILURE -
ZIP_ACCESS_VERBOSE
public static boolean ZIP_ACCESS_VERBOSE -
JRT_ACCESS_VERBOSE
public static boolean JRT_ACCESS_VERBOSE -
throwIoExceptionsInGetZipFile
public static boolean throwIoExceptionsInGetZipFileFor use in the JDT unit tests only. Used for testing error handling. Causes anIOException
to be thrown ingetZipFile(org.eclipse.core.runtime.IPath)
whenever it attempts to read a zip file.
-
-
Methodendetails
-
conflictsWithOutputLocation
public static boolean conflictsWithOutputLocation(org.eclipse.core.runtime.IPath folderPath, JavaProject project) Returns whether the given full path (for a package) conflicts with the output location of the given project. -
containerGet
public IClasspathContainer containerGet(IJavaProject project, org.eclipse.core.runtime.IPath containerPath) -
containerGetDefaultToPreviousSession
public IClasspathContainer containerGetDefaultToPreviousSession(IJavaProject project, org.eclipse.core.runtime.IPath containerPath) -
containerBeingInitializedPut
public void containerBeingInitializedPut(IJavaProject project, org.eclipse.core.runtime.IPath containerPath, IClasspathContainer container) -
containerBeingInitializedGet
public IClasspathContainer containerBeingInitializedGet(IJavaProject project, org.eclipse.core.runtime.IPath containerPath) -
containerBeingInitializedRemove
public IClasspathContainer containerBeingInitializedRemove(IJavaProject project, org.eclipse.core.runtime.IPath containerPath) -
containerPut
public void containerPut(IJavaProject project, org.eclipse.core.runtime.IPath containerPath, IClasspathContainer container) -
containerRemove
-
containerPutIfInitializingWithSameEntries
public boolean containerPutIfInitializingWithSameEntries(org.eclipse.core.runtime.IPath containerPath, IJavaProject[] projects, IClasspathContainer[] respectiveContainers) -
create
public static IJavaElement create(org.eclipse.core.resources.IResource resource, IJavaProject project) Returns the Java element corresponding to the given resource, ornull
if unable to associate the given resource with a Java element.The resource must be one of:
- a project - the element returned is the corresponding
IJavaProject
- a
.java
file - the element returned is the correspondingICompilationUnit
- a
.class
file - the element returned is the correspondingIClassFile
- a ZIP archive (e.g. a
.jar
, a.zip
file, etc.) - the element returned is the correspondingIPackageFragmentRoot
- a folder - the element returned is the corresponding
IPackageFragmentRoot
orIPackageFragment
- the workspace root resource - the element returned is the
IJavaModel
Creating a Java element has the side effect of creating and opening all of the element's parents if they are not yet open.
- a project - the element returned is the corresponding
-
create
Returns the Java element corresponding to the given file, its project being the given project. Returnsnull
if unable to associate the given file with a Java element.The file must be one of:
- a
.java
file - the element returned is the correspondingICompilationUnit
- a
.class
file - the element returned is the correspondingIClassFile
- a ZIP archive (e.g. a
.jar
, a.zip
file, etc.) - the element returned is the correspondingIPackageFragmentRoot
Creating a Java element has the side effect of creating and opening all of the element's parents if they are not yet open.
- a
-
create
Returns the package fragment or package fragment root corresponding to the given folder, its parent or great parent being the given project. ornull
if unable to associate the given folder with a Java element.Note that a package fragment root is returned rather than a default package.
Creating a Java element has the side effect of creating and opening all of the element's parents if they are not yet open.
-
createClassFileFrom
public static IClassFile createClassFileFrom(org.eclipse.core.resources.IFile file, IJavaProject project) Creates and returns a class file element for the given.class
file, its project being the given project. Returnsnull
if unable to recognize the class file. -
createCompilationUnitFrom
public static ICompilationUnit createCompilationUnitFrom(org.eclipse.core.resources.IFile file, IJavaProject project) Creates and returns a compilation unit element for the given.java
file, its project being the given project. Returnsnull
if unable to recognize the compilation unit. -
createJarPackageFragmentRootFrom
public static IPackageFragmentRoot createJarPackageFragmentRootFrom(org.eclipse.core.resources.IFile file, IJavaProject project) Creates and returns a handle for the given JAR file, its project being the given project. The Java model associated with the JAR's project may be created as a side effect. Returnsnull
if unable to create a JAR package fragment root. (for example, if the JAR file represents a non-Java resource) -
determineIfOnClasspath
public static IJavaElement determineIfOnClasspath(org.eclipse.core.resources.IResource resource, IJavaProject project) Returns the package fragment root represented by the resource, or the package fragment the given resource is located in, ornull
if the given resource is not on the classpath of the given project. -
addNonChainingJar
public void addNonChainingJar(org.eclipse.core.runtime.IPath path) -
addInvalidArchive
public void addInvalidArchive(org.eclipse.core.runtime.IPath path, JavaModelManager.ArchiveValidity reason) -
addExternalFile
public void addExternalFile(org.eclipse.core.runtime.IPath path) Adds a path to the external files cache. It is the responsibility of callers to determine the file's existence, as determined byFile.isFile()
. -
cacheZipFiles
Starts caching ZipFiles. Ignores if there are already clients. -
closeZipFile
-
registerDebugOptionsListener
public static void registerDebugOptionsListener(org.osgi.framework.BundleContext context) -
unregisterDebugOptionsListener
public static void unregisterDebugOptionsListener() -
createAnnotationProcessorManager
-
discardPerWorkingCopyInfo
- Löst aus:
JavaModelException
-
doneSaving
public void doneSaving(org.eclipse.core.resources.ISaveContext context) - Angegeben von:
doneSaving
in Schnittstelleorg.eclipse.core.resources.ISaveParticipant
- Siehe auch:
-
flushZipFiles
Flushes ZipFiles cache if there are no more clients. -
forceBatchInitializations
public boolean forceBatchInitializations(boolean initAfterLoad) -
getClasspathContainer
public IClasspathContainer getClasspathContainer(org.eclipse.core.runtime.IPath containerPath, IJavaProject project) throws JavaModelException - Löst aus:
JavaModelException
-
getReferencedClasspathEntries
public IClasspathEntry[] getReferencedClasspathEntries(IClasspathEntry libraryEntry, IJavaProject project) -
getDeltaProcessor
-
getDeltaState
-
getElementsOutOfSynchWithBuffers
Returns the set of elements which are out of synch with their buffers. -
getExternalManager
-
getIndexManager
-
getInfo
Returns the info for the element. -
getExistingElement
Returns the existing element in the cache that is equal to the given element. -
getExternalWorkingCopyProjects
-
getInstancePreferences
public org.eclipse.core.runtime.preferences.IEclipsePreferences getInstancePreferences()Get workspace eclipse preference for JavaCore plug-in. -
getDefaultOptions
-
getDefaultPreferences
public org.eclipse.core.runtime.preferences.IEclipsePreferences getDefaultPreferences()Get default eclipse preference for JavaCore plugin. -
getJavaModel
Returns the handle to the active Java Model. -
getJavaModelManager
Returns the singleton JavaModelManager -
getLastBuiltState
public Object getLastBuiltState(org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IProgressMonitor monitor) Returns the last built state for the given project, or null if there is none. Deserializes the state if necessary. For use by image builder and evaluation support only -
getOption
-
getOption
public String getOption(String optionName, boolean inheritJavaCoreOptions, org.eclipse.core.runtime.preferences.IEclipsePreferences projectPreferences) Returns the value of the given option for the given Eclipse preferences. If no value was already set, then inherits from the global options if specified.- Parameter:
optionName
- The name of the optioninheritJavaCoreOptions
- Tells whether the value can be inherited from global JavaCore optionsprojectPreferences
- The eclipse preferences from which to get the value- Gibt zurück:
- The value of the option. May be
null
-
knowsOption
Returns whether an option name is known or not.- Parameter:
optionName
- The name of the option- Gibt zurück:
true
when the option name is eithervalid
ordeprecated
,false
otherwise.
-
getOptionLevel
Returns the level of the given option.- Parameter:
optionName
- The name of the option- Gibt zurück:
- The level of the option as an int which may have the following
values:
UNKNOWN_OPTION
: the given option is unknownDEPRECATED_OPTION
: the given option is deprecatedVALID_OPTION
: the given option is valid
-
getOptions
-
getPerProjectInfo
public JavaModelManager.PerProjectInfo getPerProjectInfo(org.eclipse.core.resources.IProject project, boolean create) -
getPerProjectInfoCheckExistence
public JavaModelManager.PerProjectInfo getPerProjectInfoCheckExistence(org.eclipse.core.resources.IProject project) throws JavaModelException - Löst aus:
JavaModelException
-
getPerWorkingCopyInfo
public JavaModelManager.PerWorkingCopyInfo getPerWorkingCopyInfo(CompilationUnit workingCopy, boolean create, boolean recordUsage, IProblemRequestor problemRequestor) -
getPreviousSessionContainer
public IClasspathContainer getPreviousSessionContainer(org.eclipse.core.runtime.IPath containerPath, IJavaProject project) Returns a persisted container from previous session if any. Note that it is not the original container from previous session (i.e. it did not get serialized) but rather a summary of its entries recreated for CP initialization purpose. As such it should not be stored into container caches. -
getPreviousSessionVariable
Returns a persisted container from previous session if any -
getTemporaryCache
Returns the temporary cache for newly opened elements for the current thread. Creates it if not already created. -
getRegisteredVariableNames
Returns the name of the variables for which an CP variable initializer is registered through an extension point -
getRegisteredContainerIDs
Returns the name of the container IDs for which an CP container initializer is registered through an extension point -
resolveVariableEntry
-
getResolvedVariablePath
public org.eclipse.core.runtime.IPath getResolvedVariablePath(org.eclipse.core.runtime.IPath variablePath, boolean usePreviousSession) -
getUserLibraryManager
-
getModulePathManager
-
getWorkingCopies
-
getWorkspaceScope
-
isJrt
public static boolean isJrt(org.eclipse.core.runtime.IPath path) -
isJrt
-
verifyArchiveContent
public void verifyArchiveContent(org.eclipse.core.runtime.IPath path) throws org.eclipse.core.runtime.CoreException - Löst aus:
org.eclipse.core.runtime.CoreException
-
getZipFile
public ZipFile getZipFile(org.eclipse.core.runtime.IPath path) throws org.eclipse.core.runtime.CoreException Returns the open ZipFile at the given path. If the ZipFile does not yet exist, it is created, opened, and added to the cache of open ZipFiles. The path must be a file system path if representing an external zip/jar, or it must be an absolute workspace relative path if representing a zip/jar inside the workspace.- Löst aus:
org.eclipse.core.runtime.CoreException
- If unable to create/open the ZipFile. The cause will be aZipException
if the file was corrupt, aFileNotFoundException
if the file does not exist, or aIOException
if we were unable to read the file.
-
getZipFile
public ZipFile getZipFile(org.eclipse.core.runtime.IPath path, boolean checkInvalidArchiveCache) throws org.eclipse.core.runtime.CoreException - Löst aus:
org.eclipse.core.runtime.CoreException
-
getLocalFile
public static File getLocalFile(org.eclipse.core.runtime.IPath path) throws org.eclipse.core.runtime.CoreException - Löst aus:
org.eclipse.core.runtime.CoreException
-
hasTemporaryCache
public boolean hasTemporaryCache() -
initializePreferences
public void initializePreferences()Initialize preferences lookups for JavaCore plug-in. -
intern
public char[] intern(char[] array) -
intern
-
isClasspathBeingResolved
-
isNonChainingJar
public boolean isNonChainingJar(org.eclipse.core.runtime.IPath path) -
getArchiveValidity
-
removeFromInvalidArchiveCache
public void removeFromInvalidArchiveCache(org.eclipse.core.runtime.IPath path) -
isExternalFile
public boolean isExternalFile(org.eclipse.core.runtime.IPath path) Returns the cached value for whether the file referred to bypath
exists and is a file, as determined by the return value ofFile.isFile()
. -
clearExternalFileState
public void clearExternalFileState(org.eclipse.core.runtime.IPath path) Removes the cached state of a single entry in the externalFiles cache. -
resetExternalFilesCache
public void resetExternalFilesCache()Resets the entire externalFiles cache. -
isAssumedExternalFile
public boolean isAssumedExternalFile(org.eclipse.core.runtime.IPath path) Returns whether the providedIPath
appears to be an external file, which is true if the path does not represent an internal resource, does not exist on the file system, and does have a file extension (this is the definition provided byExternalFoldersManager.isExternalFolderPath(org.eclipse.core.runtime.IPath)
). -
addAssumedExternalFile
public void addAssumedExternalFile(org.eclipse.core.runtime.IPath path) Adds the providedIPath
to the list of assumed external files. -
setClasspathBeingResolved
-
loadVariablesAndContainers
public void loadVariablesAndContainers() throws org.eclipse.core.runtime.CoreException- Löst aus:
org.eclipse.core.runtime.CoreException
-
peekAtInfo
Returns the info for this element without disturbing the cache ordering. -
prepareToSave
public void prepareToSave(org.eclipse.core.resources.ISaveContext context) - Angegeben von:
prepareToSave
in Schnittstelleorg.eclipse.core.resources.ISaveParticipant
- Siehe auch:
-
putInfos
protected Object putInfos(IJavaElement openedElement, Object newInfo, boolean forceAdd, Map<IJavaElement, Object> newElements) -
putJarTypeInfo
Remember the info for the jar binary type- Parameter:
info
- instanceof IBinaryType orJavaModelCache.NON_EXISTING_JAR_TYPE_INFO
-
readState
protected Object readState(org.eclipse.core.resources.IProject project) throws org.eclipse.core.runtime.CoreException Reads the build state for the relevant project.- Löst aus:
org.eclipse.core.runtime.CoreException
-
recreatePersistedContainer
-
rememberScope
Remembers the given scope in a weak set (so no need to remove it: it will be removed by the garbage collector) -
removeInfoAndChildren
- Löst aus:
JavaModelException
-
removePerProjectInfo
-
resetProjectOptions
-
resetProjectPreferences
-
doNotUse
public static final void doNotUse() -
resetJarTypeCache
protected void resetJarTypeCache() -
resetClasspathListCache
public void resetClasspathListCache() -
resetTemporaryCache
public void resetTemporaryCache() -
rollback
public void rollback(org.eclipse.core.resources.ISaveContext context) - Angegeben von:
rollback
in Schnittstelleorg.eclipse.core.resources.ISaveParticipant
- Siehe auch:
-
trace
-
trace
-
traceDumpStack
public static void traceDumpStack() -
saving
public void saving(org.eclipse.core.resources.ISaveContext context) throws org.eclipse.core.runtime.CoreException - Angegeben von:
saving
in Schnittstelleorg.eclipse.core.resources.ISaveParticipant
- Löst aus:
org.eclipse.core.runtime.CoreException
- Siehe auch:
-
secondaryTypeAdding
Add a secondary type in temporary indexing cache for a project got from given path. Current secondary types cache is not modified as we want to wait that indexing was finished before taking new secondary types into account.- Siehe auch:
-
secondaryTypes
public Map<String,Map<String, secondaryTypesIType>> (IJavaProject project, boolean waitForIndexes, org.eclipse.core.runtime.IProgressMonitor monitor) throws JavaModelException Get all secondary types for a project and store result in per project info cache.This cache is an
Hashtable<String, HashMap<String, IType>>
:- key: package name
- value:
- key: type name
- value: java model handle for the secondary type
- Parameter:
project
- Project we want get secondary types from- Gibt zurück:
- HashMap Table of secondary type names->path for given project
- Löst aus:
JavaModelException
-
secondaryTypesRemoving
public void secondaryTypesRemoving(org.eclipse.core.resources.IFile file, boolean cleanIndexCache) Remove from secondary types cache all types belonging to a given file. Clean secondary types cache built while indexing if requested. Project's secondary types cache is found using file location.- Parameter:
file
- File to remove
-
setBuildOrder
Record the order in which to build the java projects (batch build). This order is based on the projects classpath settings.- Löst aus:
JavaModelException
-
setLastBuiltState
Sets the last built state for the given project, or null to reset it. -
storePreference
public boolean storePreference(String optionName, String optionValue, org.eclipse.core.runtime.preferences.IEclipsePreferences eclipsePreferences, Map<String, String> otherOptions) Store the preferences value for the given option name.- Parameter:
optionName
- The name of the optionoptionValue
- The value of the option. Ifnull
, then the option will be removed from the preferences instead.eclipsePreferences
- The eclipse preferences to be updatedotherOptions
- more options being stored, used to avoid conflict between deprecated option and its compatible- Gibt zurück:
true
if the preferences have been changed,false
otherwise.
-
setOptions
-
startup
public void startup() throws org.eclipse.core.runtime.CoreException- Löst aus:
org.eclipse.core.runtime.CoreException
-
shutdown
public void shutdown() -
variableGet
-
variableNames
-
variablePut
-
variablePreferencesPut
public void variablePreferencesPut(String variableName, org.eclipse.core.runtime.IPath variablePath) -
variablePutIfInitializingWithSameValue
public boolean variablePutIfInitializingWithSameValue(String[] variableNames, org.eclipse.core.runtime.IPath[] variablePaths) -
contentTypeChanged
public void contentTypeChanged(org.eclipse.core.runtime.content.IContentTypeManager.ContentTypeChangeEvent event) - Angegeben von:
contentTypeChanged
in Schnittstelleorg.eclipse.core.runtime.content.IContentTypeManager.IContentTypeChangeListener
-
cacheToString
-
debugNewOpenableCacheStats
-
getOpenableCacheSize
public int getOpenableCacheSize() -
getAccessRule
Get a cached access rule, or when the cache did not contain the rule, creates a new one.- Parameter:
filePattern
- the file pattern this access rule should matchkind
- one ofIAccessRule.K_ACCESSIBLE
,IAccessRule.K_DISCOURAGED
, orIAccessRule.K_NON_ACCESSIBLE
, optionally combined withIAccessRule.IGNORE_IF_BETTER
- Gibt zurück:
- an access rule
-
getAccessRuleForProblemId
Used only for loading rules from disk.
-