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. IElementChangedListeners register with the JavaModelManager, and receive ElementChangedEvents for all IJavaModels.

The single instance of JavaModelManager is available from the static method JavaModelManager.getJavaModelManager().

  • Felddetails

    • variables

      public HashMap<String,org.eclipse.core.runtime.IPath> variables
      Classpath variables pool
    • variablesWithInitializer

      public HashSet<String> variablesWithInitializer
    • deprecatedVariables

      public HashMap<String,String> deprecatedVariables
    • readOnlyVariables

      public HashSet<String> readOnlyVariables
    • previousSessionVariables

      public HashMap<String,org.eclipse.core.runtime.IPath> previousSessionVariables
    • containers

      public HashMap<IJavaProject,Map<org.eclipse.core.runtime.IPath,IClasspathContainer>> containers
      Classpath containers pool
    • previousSessionContainers

      public HashMap<IJavaProject,Map<org.eclipse.core.runtime.IPath,IClasspathContainer>> previousSessionContainers
    • 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

      public Object batchContainerInitializationsLock
    • batchContainerInitializationsProgress

      public BatchInitializationMonitor batchContainerInitializationsProgress
    • containerInitializersCache

      public Hashtable<String,ClasspathContainerInitializer> containerInitializersCache
    • workspaceScope

      public JavaWorkspaceScope workspaceScope
    • rootPathToAttachments

      public Map<org.eclipse.core.runtime.IPath,String> rootPathToAttachments
    • CP_VARIABLE_PREFERENCES_PREFIX

      public static final String CP_VARIABLE_PREFERENCES_PREFIX
      Siehe auch:
    • CP_CONTAINER_PREFERENCES_PREFIX

      public static final String CP_CONTAINER_PREFERENCES_PREFIX
      Siehe auch:
    • CP_USERLIBRARY_PREFERENCES_PREFIX

      public static final String CP_USERLIBRARY_PREFERENCES_PREFIX
      Siehe auch:
    • CP_ENTRY_IGNORE

      public static final String CP_ENTRY_IGNORE
      Siehe auch:
    • CP_ENTRY_IGNORE_PATH

      public static final org.eclipse.core.runtime.IPath CP_ENTRY_IGNORE_PATH
    • TRUE

      public static final String TRUE
      Siehe auch:
    • CPVARIABLE_INITIALIZER_EXTPOINT_ID

      public static final String CPVARIABLE_INITIALIZER_EXTPOINT_ID
      Name of the extension point for contributing classpath variable initializers
      Siehe auch:
    • CPCONTAINER_INITIALIZER_EXTPOINT_ID

      public static final String CPCONTAINER_INITIALIZER_EXTPOINT_ID
      Name of the extension point for contributing classpath container initializers
      Siehe auch:
    • FORMATTER_EXTPOINT_ID

      public static final String FORMATTER_EXTPOINT_ID
      Name of the extension point for contributing a source code formatter
      Siehe auch:
    • COMPILATION_PARTICIPANT_EXTPOINT_ID

      public static final String COMPILATION_PARTICIPANT_EXTPOINT_ID
      Name of the extension point for contributing a compilation participant
      Siehe auch:
    • ANNOTATION_PROCESSOR_MANAGER_EXTPOINT_ID

      public static final String 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

      public static final String 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 by AbstractImageBuilder#MAX_AT_ONCE.
      Siehe auch:
    • VARIABLE_INITIALIZATION_IN_PROGRESS

      public static final org.eclipse.core.runtime.IPath VARIABLE_INITIALIZATION_IN_PROGRESS
      Special value used for recognizing ongoing initialization and breaking initialization cycles
    • CONTAINER_INITIALIZATION_IN_PROGRESS

      public static final IClasspathContainer CONTAINER_INITIALIZATION_IN_PROGRESS
    • COMPLETION_PERF

      public static final String COMPLETION_PERF
      Siehe auch:
    • SELECTION_PERF

      public static final String SELECTION_PERF
      Siehe auch:
    • DELTA_LISTENER_PERF

      public static final String DELTA_LISTENER_PERF
      Siehe auch:
    • VARIABLE_INITIALIZER_PERF

      public static final String VARIABLE_INITIALIZER_PERF
      Siehe auch:
    • CONTAINER_INITIALIZER_PERF

      public static final String CONTAINER_INITIALIZER_PERF
      Siehe auch:
    • RECONCILE_PERF

      public static final String 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

      public static final ICompilationUnit[] NO_WORKING_COPY
    • preferencesLookup

      public final org.eclipse.core.runtime.preferences.IEclipsePreferences[] preferencesLookup
    • compilationParticipants

      public final JavaModelManager.CompilationParticipants compilationParticipants
    • abortOnMissingSource

      public ThreadLocal<Boolean> abortOnMissingSource
    • elementsOutOfSynchWithBuffers

      protected HashSet<Openable> elementsOutOfSynchWithBuffers
      Set of elements which are out of sync with their buffers.
    • deltaState

      public DeltaProcessingState deltaState
      Holds the state used for delta processing.
    • indexManager

      public IndexManager indexManager
    • perProjectInfos

      protected Map<org.eclipse.core.resources.IProject,JavaModelManager.PerProjectInfo> perProjectInfos
      Table from IProject to PerProjectInfo. NOTE: this object itself is used as a lock to synchronize creation/removal of per project infos
    • perWorkingCopyInfos

      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

      protected WeakHashMap<AbstractSearchScope,?> 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 throwIoExceptionsInGetZipFile
      For use in the JDT unit tests only. Used for testing error handling. Causes an IOException to be thrown in getZipFile(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

      public void containerRemove(IJavaProject project)
    • 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, or null 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 corresponding ICompilationUnit
      • a .class file - the element returned is the corresponding IClassFile
      • a ZIP archive (e.g. a .jar, a .zip file, etc.) - the element returned is the corresponding IPackageFragmentRoot
      • a folder - the element returned is the corresponding IPackageFragmentRoot or IPackageFragment
      • 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.

    • create

      public 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. Returns null 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 corresponding ICompilationUnit
      • a .class file - the element returned is the corresponding IClassFile
      • a ZIP archive (e.g. a .jar, a .zip file, etc.) - the element returned is the corresponding IPackageFragmentRoot

      Creating a Java element has the side effect of creating and opening all of the element's parents if they are not yet open.

    • create

      public 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. or null 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. Returns null 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. Returns null 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. Returns null 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, or null 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 by File.isFile().
    • cacheZipFiles

      public void cacheZipFiles(Object owner)
      Starts caching ZipFiles. Ignores if there are already clients.
    • closeZipFile

      public void closeZipFile(ZipFile zipFile)
    • registerDebugOptionsListener

      public static void registerDebugOptionsListener(org.osgi.framework.BundleContext context)
    • unregisterDebugOptionsListener

      public static void unregisterDebugOptionsListener()
    • createAnnotationProcessorManager

      public AbstractAnnotationProcessorManager createAnnotationProcessorManager()
    • discardPerWorkingCopyInfo

      public int discardPerWorkingCopyInfo(CompilationUnit workingCopy) throws JavaModelException
      Löst aus:
      JavaModelException
    • doneSaving

      public void doneSaving(org.eclipse.core.resources.ISaveContext context)
      Angegeben von:
      doneSaving in Schnittstelle org.eclipse.core.resources.ISaveParticipant
      Siehe auch:
      • ISaveParticipant
    • flushZipFiles

      public void flushZipFiles(Object owner)
      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

      public DeltaProcessor getDeltaProcessor()
    • getDeltaState

      public static DeltaProcessingState getDeltaState()
    • getElementsOutOfSynchWithBuffers

      protected HashSet<Openable> getElementsOutOfSynchWithBuffers()
      Returns the set of elements which are out of synch with their buffers.
    • getExternalManager

      public static ExternalFoldersManager getExternalManager()
    • getIndexManager

      public static IndexManager getIndexManager()
    • getInfo

      public Object getInfo(IJavaElement element)
      Returns the info for the element.
    • getExistingElement

      public IJavaElement getExistingElement(IJavaElement element)
      Returns the existing element in the cache that is equal to the given element.
    • getExternalWorkingCopyProjects

      public HashSet<IJavaProject> getExternalWorkingCopyProjects()
    • getInstancePreferences

      public org.eclipse.core.runtime.preferences.IEclipsePreferences getInstancePreferences()
      Get workspace eclipse preference for JavaCore plug-in.
    • getDefaultOptions

      public Hashtable<String,String> getDefaultOptions()
    • getDefaultPreferences

      public org.eclipse.core.runtime.preferences.IEclipsePreferences getDefaultPreferences()
      Get default eclipse preference for JavaCore plugin.
    • getJavaModel

      public final JavaModel getJavaModel()
      Returns the handle to the active Java Model.
    • getJavaModelManager

      public static final JavaModelManager 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

      public String getOption(String optionName)
    • 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 option
      inheritJavaCoreOptions - Tells whether the value can be inherited from global JavaCore options
      projectPreferences - The eclipse preferences from which to get the value
      Gibt zurück:
      The value of the option. May be null
    • knowsOption

      public boolean knowsOption(String optionName)
      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 either valid or deprecated, false otherwise.
    • getOptionLevel

      public int getOptionLevel(String optionName)
      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 unknown
      • DEPRECATED_OPTION: the given option is deprecated
      • VALID_OPTION: the given option is valid
    • getOptions

      public Hashtable<String,String> 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

      public org.eclipse.core.runtime.IPath getPreviousSessionVariable(String variableName)
      Returns a persisted container from previous session if any
    • getTemporaryCache

      public HashMap<IJavaElement,Object> getTemporaryCache()
      Returns the temporary cache for newly opened elements for the current thread. Creates it if not already created.
    • getRegisteredVariableNames

      public static String[] getRegisteredVariableNames()
      Returns the name of the variables for which an CP variable initializer is registered through an extension point
    • getRegisteredContainerIDs

      public static String[] getRegisteredContainerIDs()
      Returns the name of the container IDs for which an CP container initializer is registered through an extension point
    • resolveVariableEntry

      public IClasspathEntry resolveVariableEntry(IClasspathEntry entry, boolean usePreviousSession)
    • getResolvedVariablePath

      public org.eclipse.core.runtime.IPath getResolvedVariablePath(org.eclipse.core.runtime.IPath variablePath, boolean usePreviousSession)
    • getUserLibraryManager

      public static UserLibraryManager getUserLibraryManager()
    • getModulePathManager

      public static ModuleSourcePathManager getModulePathManager()
    • getWorkingCopies

      public ICompilationUnit[] getWorkingCopies(WorkingCopyOwner owner, boolean addPrimary)
    • getWorkspaceScope

      public JavaWorkspaceScope getWorkspaceScope()
    • isJrt

      public static boolean isJrt(org.eclipse.core.runtime.IPath path)
    • isJrt

      public static boolean isJrt(String path)
    • 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 a ZipException if the file was corrupt, a FileNotFoundException if the file does not exist, or a IOException 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

      public String intern(String s)
    • isClasspathBeingResolved

      public boolean isClasspathBeingResolved(IJavaProject project)
    • isNonChainingJar

      public boolean isNonChainingJar(org.eclipse.core.runtime.IPath path)
    • getArchiveValidity

      public JavaModelManager.ArchiveValidity getArchiveValidity(org.eclipse.core.runtime.IPath path)
    • 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 by path exists and is a file, as determined by the return value of File.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 provided IPath 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 by ExternalFoldersManager.isExternalFolderPath(org.eclipse.core.runtime.IPath)).
    • addAssumedExternalFile

      public void addAssumedExternalFile(org.eclipse.core.runtime.IPath path)
      Adds the provided IPath to the list of assumed external files.
    • setClasspathBeingResolved

      public void setClasspathBeingResolved(IJavaProject project, boolean classpathIsResolved)
    • loadVariablesAndContainers

      public void loadVariablesAndContainers() throws org.eclipse.core.runtime.CoreException
      Löst aus:
      org.eclipse.core.runtime.CoreException
    • peekAtInfo

      protected Object peekAtInfo(IJavaElement element)
      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 Schnittstelle org.eclipse.core.resources.ISaveParticipant
      Siehe auch:
      • ISaveParticipant
    • putInfos

      protected Object putInfos(IJavaElement openedElement, Object newInfo, boolean forceAdd, Map<IJavaElement,Object> newElements)
    • putJarTypeInfo

      protected void putJarTypeInfo(IJavaElement type, Object info)
      Remember the info for the jar binary type
      Parameter:
      info - instanceof IBinaryType or JavaModelCache.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

      public static void recreatePersistedContainer(String propertyName, String containerString, boolean addToContainerValues)
    • rememberScope

      public 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)
    • removeInfoAndChildren

      public Object removeInfoAndChildren(JavaElement element) throws JavaModelException
      Löst aus:
      JavaModelException
    • removePerProjectInfo

      public void removePerProjectInfo(JavaProject javaProject, boolean removeExtJarInfo)
    • resetProjectOptions

      public void resetProjectOptions(JavaProject javaProject)
    • resetProjectPreferences

      public void resetProjectPreferences(JavaProject javaProject)
    • 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 Schnittstelle org.eclipse.core.resources.ISaveParticipant
      Siehe auch:
      • ISaveParticipant
    • saving

      public void saving(org.eclipse.core.resources.ISaveContext context) throws org.eclipse.core.runtime.CoreException
      Angegeben von:
      saving in Schnittstelle org.eclipse.core.resources.ISaveParticipant
      Löst aus:
      org.eclipse.core.runtime.CoreException
      Siehe auch:
      • ISaveParticipant
    • secondaryTypeAdding

      public void secondaryTypeAdding(String path, char[] typeName, char[] packageName)
      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,IType>> secondaryTypes(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
      Hashtable was used to protect callers from possible concurrent access.

      Note, if indexing is not finished and caller does not wait for the end of indexing, returned map is the current secondary types cache content which may be invalid...
      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

      protected void setBuildOrder(String[] javaBuildOrder) throws JavaModelException
      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

      public void setLastBuiltState(org.eclipse.core.resources.IProject project, Object state)
      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 option
      optionValue - The value of the option. If null, then the option will be removed from the preferences instead.
      eclipsePreferences - The eclipse preferences to be updated
      otherOptions - 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

      public void setOptions(Hashtable<String,String> newOptions)
    • startup

      public void startup() throws org.eclipse.core.runtime.CoreException
      Löst aus:
      org.eclipse.core.runtime.CoreException
    • shutdown

      public void shutdown()
    • variableGet

      public org.eclipse.core.runtime.IPath variableGet(String variableName)
    • variableNames

      public String[] variableNames()
    • variablePut

      public void variablePut(String variableName, org.eclipse.core.runtime.IPath variablePath)
    • 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 Schnittstelle org.eclipse.core.runtime.content.IContentTypeManager.IContentTypeChangeListener
    • cacheToString

      public String cacheToString(String prefix)
    • debugNewOpenableCacheStats

      public LRUCache<ITypeRoot,JavaElementInfo>.Stats debugNewOpenableCacheStats()
    • getOpenableCacheSize

      public int getOpenableCacheSize()
    • getAccessRule

      public IAccessRule 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.
      Parameter:
      filePattern - the file pattern this access rule should match
      kind - one of IAccessRule.K_ACCESSIBLE, IAccessRule.K_DISCOURAGED, or IAccessRule.K_NON_ACCESSIBLE, optionally combined with IAccessRule.IGNORE_IF_BETTER
      Gibt zurück:
      an access rule
    • getAccessRuleForProblemId

      public ClasspathAccessRule getAccessRuleForProblemId(char[] filePattern, int problemId)
      Used only for loading rules from disk.