Class ExternalJavaProject
- All Implemented Interfaces:
IBufferChangedListener, IJavaElement, IJavaProject, IOpenable, IParent, SuffixConstants, org.eclipse.core.runtime.IAdaptable
-
Nested Class Summary
Nested classes/interfaces inherited from class JavaProject
JavaProject.ClasspathResolutionBreakpointListener -
Field Summary
FieldsFields inherited from class JavaProject
CLASSPATH_FILENAME, DEFAULT_PREFERENCES_DIRNAME, FIRST_MULTI_RELEASE, INVALID_CLASSPATH, JAVA_CORE_PREFS_FILE, NO_PREREQUISITES, NO_RELEASE, projectModifier and TypeFieldDescriptionstatic final StringName of file containing project classpathstatic final StringName of directory containing preferences filestatic final intThe first java release that supports multi release jarsstatic final IClasspathEntry[]Value of the project's raw classpath if the .classpath file contains invalid entries.static final StringExtension for file containing custom project preferencesprotected static final String[]An empty array of strings indicating that a project doesn't have any prerequesite projects.static final intMarker value used in cases where a release is passed or used as an argument but no specific release is selected.protected final org.eclipse.core.resources.IProjectThe platform project thisIJavaProjectis based onFields inherited from class JavaElement
JEM_ANNOTATION, JEM_CLASSFILE, JEM_COMPILATIONUNIT, JEM_COUNT, JEM_DELIMITER_ESCAPE, JEM_ESCAPE, JEM_FIELD, JEM_IMPORTDECLARATION, JEM_INITIALIZER, JEM_JAVAPROJECT, JEM_LAMBDA_EXPRESSION, JEM_LAMBDA_METHOD, JEM_LOCALVARIABLE, JEM_METHOD, JEM_MODULAR_CLASSFILE, JEM_MODULE, JEM_PACKAGEDECLARATION, JEM_PACKAGEFRAGMENT, JEM_PACKAGEFRAGMENTROOT, JEM_STRING, JEM_TYPE, JEM_TYPE_PARAMETER, NO_ELEMENTS, NO_INFO, NO_STRINGSModifier and TypeFieldDescriptionstatic final charstatic final charstatic final charstatic final charstatic final charBefore ')','&'and '"' became the newest additions as delimiters, the former two were allowed as part of element attributes and possibly stored.static final charstatic final charstatic final charstatic final charstatic final charstatic final charstatic final charstatic final charstatic final charstatic final charstatic final charstatic final charstatic final charstatic final charstatic final charstatic final charstatic final charprotected static final JavaElement[]protected static final Objectstatic final String[]Fields inherited from interface IJavaElement
ANNOTATION, CLASS_FILE, COMPILATION_UNIT, FIELD, IMPORT_CONTAINER, IMPORT_DECLARATION, INITIALIZER, JAVA_MODEL, JAVA_MODULE, JAVA_PROJECT, LOCAL_VARIABLE, METHOD, PACKAGE_DECLARATION, PACKAGE_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE, TYPE_PARAMETERModifier and TypeFieldDescriptionstatic final intConstant representing an annotation.static final intConstant representing a class file.static final intConstant representing a Java compilation unit.static final intConstant representing a field.static final intConstant representing all import declarations within a compilation unit.static final intConstant representing an import declaration within a compilation unit.static final intConstant representing a stand-alone instance or class initializer.static final intConstant representing a Java model (workspace level object).static final intConstant represents a module descriptor.static final intConstant representing a Java project.static final intConstant representing a local variable declaration.static final intConstant representing a method or constructor.static final intConstant representing a package declaration within a compilation unit.static final intConstant representing a package fragment.static final intConstant representing a package fragment root.static final intConstant representing a type (a class or interface).static final intConstant representing a type parameter declaration.Fields inherited from interface IJavaProject
CLASSPATH_FILE_NAMEModifier and TypeFieldDescriptionstatic final StringPath of the file containing the project's classpath relative to the project's root.Fields inherited from interface SuffixConstants
EXTENSION_aj, EXTENSION_AJ, EXTENSION_class, EXTENSION_CLASS, EXTENSION_java, EXTENSION_JAVA, EXTENSION_jmod, EXTENSION_JMOD, SUFFIX_aj, SUFFIX_AJ, SUFFIX_class, SUFFIX_CLASS, SUFFIX_java, SUFFIX_JAVA, SUFFIX_STRING_aj, SUFFIX_STRING_AJ, SUFFIX_STRING_class, SUFFIX_STRING_CLASS, SUFFIX_STRING_java, SUFFIX_STRING_JAVAModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final char[]static final char[]static final char[]static final char[]static final char[]static final char[]static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if this handle represents the same Java project as the given handle.booleanexists()Returns whether this Java element exists in the model.Helper method for returning one option value only.booleanisOnClasspath(IJavaElement element) Returns whether the given element is on the classpath of this project, that is, referenced from a classpath entry and not explicitly excluded using an exclusion pattern.booleanisOnClasspath(org.eclipse.core.resources.IResource resource) Returns whether the given resource is on the classpath of this project, that is, referenced from a classpath entry and not explicitly excluded using an exclusion pattern.protected org.eclipse.core.runtime.IStatusvalidateExistence(org.eclipse.core.resources.IResource underlyingResource) Methods inherited from class JavaProject
addCPResolutionBPListener, areClasspathsEqual, buildStructure, calculateHashCode, canonicalizedPath, close, computePackageFragmentRoots, computePackageFragmentRoots, computePackageFragmentRoots, computePackageFragmentRoots, computePackageFragmentRoots, computePackageFragmentRoots, computePackageFragmentRoots, computePackageFragmentRoots, computeSharedPropertyFileName, contains, createClasspathProblemMarker, createElementInfo, createPackageFragementKey, decodeClasspath, decodeClasspathEntry, defaultClasspath, defaultOutputLocation, defaultRootModules, defaultRootModules, determineModulesOfProjectsWithNonEmptyClasspath, encodeClasspath, encodeClasspathEntry, findContainingClasspathEntry, findElement, findElement, findElement, findModule, findPackageFragment, findPackageFragment, findPackageFragmentRoot, findPackageFragmentRoot0, findPackageFragmentRoots, findType, findType, findType, findType, findType, findType, findType, findType, findUnfilteredPackageFragmentRoots, flushClasspathProblemMarkers, getAccessRestrictions, getAllPackageFragmentRoots, getAllPackageFragmentRoots, getAllPackageFragmentRoots, getAutomaticModuleDescription, getClasspathEntryFor, getCycleMarker, getEclipsePreferences, getElementName, getElementType, getExpandedClasspath, getExpandedClasspath, getFolderPackageFragmentRoot, getHandleFromMemento, getHandleMementoDelimiter, getJavaModel, getJavaProject, getJavaProjectElementInfo, getManifest, getModuleDescription, getModuleDescription, getNonJavaResources, getOptions, getOutputLocation, getOwnModuleDescription, getOwnModuleDescription, getPackageFragmentRoot, getPackageFragmentRoot, getPackageFragmentRoot, getPackageFragmentRoot, getPackageFragmentRoot0, getPackageFragmentRoots, getPackageFragmentRoots, getPackageFragments, getPackageFragmentsInRoots, getPatchedModules, getPath, getPerProjectInfo, getProject, getProjectCache, getProjectCache, getRawClasspath, getReferencedClasspathEntries, getRelease, getRelease, getRelease, getRequiredProjectNames, getResolvedClasspath, getResolvedClasspath, getSharedProperty, getSourceMapper, getUnderlyingResource, hasBuildState, hasClasspathCycle, hasCycleMarker, hasJavaNature, hasSource, internalDefaultRootModules, newEvaluationContext, newNameLookup, newNameLookup, newNameLookup, newNameLookup, newSearchableNameEnvironment, newSearchableNameEnvironment, newSearchableNameEnvironment, newSearchableNameEnvironment, newSearchableNameEnvironment, newSearchableNameEnvironment, newTemporaryInfo, newTypeHierarchy, newTypeHierarchy, newTypeHierarchy, newTypeHierarchy, projectPrerequisites, readFileEntriesWithException, readOutputLocation, readRawClasspath, removeCPResolutionBPListener, resetCaches, resetResolvedClasspath, resolveClasspath, resolveClasspath, resolveClasspath, resolveClasspath, resource, rootID, setModuleDescription, setOption, setOptions, setOutputLocation, setRawClasspath, setRawClasspath, setRawClasspath, setRawClasspath, setRawClasspath, setRawClasspath, setSharedProperty, updateCycleParticipants, validateCycles, writeFileEntries, writeFileEntriesModifier and TypeMethodDescriptionstatic voidstatic booleanareClasspathsEqual(IClasspathEntry[] firstClasspath, IClasspathEntry[] secondClasspath, org.eclipse.core.runtime.IPath firstOutputLocation, org.eclipse.core.runtime.IPath secondOutputLocation) protected booleanbuildStructure(OpenableElementInfo info, org.eclipse.core.runtime.IProgressMonitor pm, Map newElements, org.eclipse.core.resources.IResource underlyingResource) Builds this element's structure and properties in the given info object, based on this element's current contents (reuse buffer contents if this element has an open buffer, or resource contents if this element does not have an open buffer).protected intstatic org.eclipse.core.runtime.IPathcanonicalizedPath(org.eclipse.core.runtime.IPath externalPath) Deprecated.This method may not do what you expect from its name (see bug 571614):voidclose()Closes this element and its buffer (if any).computePackageFragmentRoots(IClasspathEntry resolvedEntry) Computes the package fragment roots identified by the given entry.computePackageFragmentRoots(IClasspathEntry[] resolvedClasspath, boolean retrieveExportedRoots, boolean filterModuleRoots, Map rootToResolvedEntries) computePackageFragmentRoots(IClasspathEntry[] resolvedClasspath, boolean retrieveExportedRoots, boolean filterModuleRoots, Map rootToResolvedEntries, boolean excludeTestCode) Returns (local/all) the package fragment roots identified by the given project's classpath.voidcomputePackageFragmentRoots(IClasspathEntry[] resolvedClasspath, ObjectVector accumulatedRoots, HashSet rootIDs, IClasspathEntry referringEntry, boolean retrieveExportedRoots, boolean filterModuleRoots, Map rootToResolvedEntries) Deprecated.voidcomputePackageFragmentRoots(IClasspathEntry[] resolvedClasspath, ObjectVector accumulatedRoots, HashSet rootIDs, IClasspathEntry referringEntry, boolean retrieveExportedRoots, boolean filterModuleRoots, Map rootToResolvedEntries, boolean excludeTestCode) Returns (local/all) the package fragment roots identified by the given project's classpath.voidcomputePackageFragmentRoots(IClasspathEntry resolvedEntry, ObjectVector accumulatedRoots, HashSet rootIDs, IClasspathEntry referringEntry, boolean retrieveExportedRoots, boolean filterModuleRoots, Map rootToResolvedEntries) voidcomputePackageFragmentRoots(IClasspathEntry resolvedEntry, ObjectVector accumulatedRoots, HashSet rootIDs, IClasspathEntry referringEntry, boolean retrieveExportedRoots, boolean filterModuleRoots, Map rootToResolvedEntries, boolean excludeTestCode) Returns the package fragment roots identified by the given entry.voidcomputePackageFragmentRoots(IClasspathEntry resolvedEntry, ObjectVector accumulatedRoots, HashSet rootIDs, IClasspathEntry referringEntry, boolean retrieveExportedRoots, Map rootToResolvedEntries) Returns the package fragment roots identified by the given entry.computeSharedPropertyFileName(org.eclipse.core.runtime.QualifiedName qName) Compute the file name to use for a given shared propertybooleancontains(org.eclipse.core.resources.IResource resource) voidRecord a new marker denoting a classpath problemprotected org.aspectj.org.eclipse.jdt.internal.core.JavaProjectElementInfoReturns a new element info for this element.static org.eclipse.core.runtime.IPathcreatePackageFragementKey(org.eclipse.core.runtime.IPath externalPath) Does nothing by default.IClasspathEntry[][]decodeClasspath(String xmlClasspath, Map unknownElements) Reads and decode an XML classpath string.decodeClasspathEntry(String encodedEntry) Decodes the classpath entry that has been encoded in the given string in the context of this project.protected IClasspathEntry[]Returns a default class path.protected org.eclipse.core.runtime.IPathReturns a default output location.defaultRootModules(Iterable<IPackageFragmentRoot> allSystemRoots) Deprecated.This method cannot distinguish strategies for old (9/10) vs new (11+) JDK versions.defaultRootModules(Iterable<IPackageFragmentRoot> allSystemRoots, String releaseVersion) Implements selection of root modules per JEP 261.When compiling test code in a modular project that has non-source classpath entries which don't have theIClasspathAttribute.MODULEset, the module is assumed to read the unnamed module (which is useful for test-only dependencies that should not be mentioned in the module-info.java).protected StringencodeClasspath(IClasspathEntry[] classpath, IClasspathEntry[] referencedEntries, org.eclipse.core.runtime.IPath outputLocation, boolean indent, Map unknownElements) Returns the XML String encoding of the class path.encodeClasspathEntry(IClasspathEntry classpathEntry) Encodes the given classpath entry into a string in the context of this project.findContainingClasspathEntry(org.eclipse.core.resources.IResource resource) Returns the class path entry which contains the given resource and not explicitly excluded using an exclusion pattern, or null otherwise.findElement(String bindingKey, WorkingCopyOwner owner) Finds the Java element corresponding to the given binding key if any, else returnsnull.findElement(org.eclipse.core.runtime.IPath path) Returns theIJavaElementcorresponding to the given classpath-relative path, ornullif no suchIJavaElementis found.findElement(org.eclipse.core.runtime.IPath path, WorkingCopyOwner owner) Returns theIJavaElementcorresponding to the given classpath-relative path, ornullif no suchIJavaElementis found.findModule(String moduleName, WorkingCopyOwner owner) Finds the first module with the given name found following this project's module path.findPackageFragment(String packageName) findPackageFragment(org.eclipse.core.runtime.IPath path) Returns the first existing package fragment on this project's classpath whose path matches the given (absolute) path, ornullif none exist.findPackageFragmentRoot(org.eclipse.core.runtime.IPath path) Returns the existing package fragment root on this project's classpath whose path matches the given (absolute) path, ornullif one does not exist.findPackageFragmentRoot0(org.eclipse.core.runtime.IPath path) Returns the existing package fragment roots identified by the given entry.Returns the first type (excluding secondary types) found following this project's classpath with the given fully qualified name ornullif none is found.Returns the first type (excluding secondary types) found following this project's classpath with the given package name and type qualified name ornullif none is found.findType(String packageName, String typeQualifiedName, WorkingCopyOwner owner) Returns the first type (excluding secondary types) found following this project's classpath with the given package name and type qualified name ornullif none is found.findType(String packageName, String typeQualifiedName, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Same functionality asIJavaProject.findType(String, String, WorkingCopyOwner)but also looks for secondary types if the given name does not match a compilation unit name.findType(String packageName, String typeQualifiedName, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Same functionality asIJavaProject.findType(String, String)but also looks for secondary types if the given name does not match a compilation unit name.findType(String fullyQualifiedName, WorkingCopyOwner owner) Returns the first type (excluding secondary types) found following this project's classpath with the given fully qualified name ornullif none is found.findType(String fullyQualifiedName, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor progressMonitor) Same functionality asIJavaProject.findType(String, WorkingCopyOwner)but also looks for secondary types if the given name does not match a compilation unit name.Same functionality asIJavaProject.findType(String)but also looks for secondary types if the given name does not match a compilation unit name.In a Java 9 project, a classpath entry can be filtered using aIClasspathAttribute.LIMIT_MODULESattribute, otherwise for an unnamed module a default set of roots is used as defined in JEP 261.protected voidflushClasspathProblemMarkers(boolean flushCycleMarkers, boolean flushClasspathFormatMarkers, boolean flushOverlappingOutputMarkers) Remove all markers denoting classpath problemsorg.eclipse.core.runtime.IPath[]getAccessRestrictions(String optionName) Returns the set of patterns corresponding to this project visibility given rulesReturns all of the existing package fragment roots that exist on the classpath, in the order they are defined by the classpath.getAllPackageFragmentRoots(Map rootToResolvedEntries) Deprecated.getAllPackageFragmentRoots(Map rootToResolvedEntries, boolean excludeTestCode) getClasspathEntryFor(org.eclipse.core.runtime.IPath path) Returns the classpath entry that refers to the given path ornullif there is no reference to the path.org.eclipse.core.resources.IMarkerorg.eclipse.core.runtime.preferences.IEclipsePreferencesReturns the project custom preference pool.Returns the name of this element.intReturns this element's kind encoded as an integer.This is a helper method returning the expanded classpath for the project, as a list of classpath entries, where all classpath variable entries have been resolved and substituted with their final target entries.getExpandedClasspath(boolean excludeTestCode) getFolderPackageFragmentRoot(org.eclipse.core.runtime.IPath path) The path is known to match a source/library folder entry.getHandleFromMemento(String token, MementoTokenizer memento, WorkingCopyOwner owner) protected charReturns thecharthat marks the start of this handles contribution to a memento.Returns the Java model.Returns the Java project this element is contained in, ornullif this element is not contained in any Java project (for instance, theIJavaModelis not contained in any Java project).protected org.aspectj.org.eclipse.jdt.internal.core.JavaProjectElementInfoConvenience method that returns the specific type of info for a Java project.Returns theIModuleDescriptionthis project represents or null if the Java project doesn't represent any named module.getModuleDescription(int release) Returns anIModuleDescriptionthis project represents or null if the Java project doesn't represent any named module.Object[]Returns an array of non-java resources contained in the receiver.getOptions(boolean inheritJavaCoreOptions) Returns the table of the current custom options for this project.org.eclipse.core.runtime.IPathReturns the default output location for this project as a workspace- relative absolute path.Returns theIModuleDescriptionowned by this project or null if the Java project doesn't own a valid Java module descriptor.getOwnModuleDescription(int release) Returns anIModuleDescriptionowned by this project ornullif the Java project doesn't own a suitable Java module descriptor.getPackageFragmentRoot(String externalLibraryPath) Returns a package fragment root for an external library (a ZIP archive - e.g.getPackageFragmentRoot(org.eclipse.core.resources.IResource resource) Returns a package fragment root for the given resource, which must either be a folder representing the top of a package hierarchy, or a ZIP archive (e.g.getPackageFragmentRoot(org.eclipse.core.resources.IResource resource, org.eclipse.core.runtime.IPath entryPath, IClasspathAttribute[] extraAttributes) getPackageFragmentRoot(org.eclipse.core.runtime.IPath path, IClasspathAttribute[] extraAttributes) getPackageFragmentRoot0(org.eclipse.core.runtime.IPath externalLibraryPath, IClasspathAttribute[] extraAttributes) Returns all of the package fragment roots contained in this project, identified on this project's resolved classpath.Deprecated.Returns all package fragments in all package fragment roots contained in this project.Returns all the package fragments found in the specified package fragment roots.getPatchedModules(IClasspathEntry cpEntry) org.eclipse.core.runtime.IPathgetPath()Returns the path to the innermost resource enclosing this element.org.eclipse.core.resources.IProjectReturns theIProjecton which thisIJavaProjectwas created.org.aspectj.org.eclipse.jdt.internal.core.JavaProjectElementInfo.ProjectCacheDeprecated.org.aspectj.org.eclipse.jdt.internal.core.JavaProjectElementInfo.ProjectCachegetProjectCache(boolean excludeTestCode) Returns the raw classpath for the project, as a list of classpath entries.Returns the list of referenced classpath entries stored in the .classpath file ofthisjava project.static intgetRelease(IClasspathEntry entry) static intgetRelease(IJavaElement element) intgetRelease(org.eclipse.core.runtime.IPath sourcePath) String[]Returns the names of the projects that are directly required by this project.getResolvedClasspath(boolean ignoreUnresolvedEntry) This is a helper method returning the resolved classpath for the project as a list of simple (non-variable, non-container) classpath entries.getSharedProperty(String key) Retrieve a shared property on a project.Returns the SourceMapper facility for this element, ornullif this element does not have a SourceMapper.org.eclipse.core.resources.IResourceReturns the smallest underlying resource that contains this element, ornullif this element is not contained in a resource.booleanReturns whether this project has been built at least once and thus whether it has a build state.booleanhasClasspathCycle(IClasspathEntry[] preferredClasspath) Returns whether setting this project's classpath to the given classpath entries would result in a cycle.booleanstatic booleanhasJavaNature(org.eclipse.core.resources.IProject project) Returns true if the given project is accessible and it has a java nature, otherwise false.booleanAnswers true if the project potentially contains any source.internalDefaultRootModules(Iterable<T> allSystemModules, Function<T, String> getModuleName, Function<T, IModule> getModule, String releaseVersion) Creates a new evaluation context.newNameLookup(ICompilationUnit[] workingCopies) newNameLookup(ICompilationUnit[] workingCopies, boolean excludeTestCode) newNameLookup(WorkingCopyOwner owner) newNameLookup(WorkingCopyOwner owner, boolean excludeTestCode) newSearchableNameEnvironment(ICompilationUnit[] workingCopies) newSearchableNameEnvironment(ICompilationUnit[] workingCopies, boolean excludeTestCode) newSearchableNameEnvironment(ICompilationUnit[] workingCopies, boolean excludeTestCode, int release) newSearchableNameEnvironment(WorkingCopyOwner owner, boolean excludeTestCode) newSearchableNameEnvironment(WorkingCopyOwner owner, boolean excludeTestCode, int release) newTypeHierarchy(IRegion region, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) Creates and returns a type hierarchy for all types in the given region, considering subtypes within that region and considering types in the working copies with the given owner.newTypeHierarchy(IRegion region, org.eclipse.core.runtime.IProgressMonitor monitor) Creates and returns a type hierarchy for all types in the given region, considering subtypes within that region.newTypeHierarchy(IType type, IRegion region, WorkingCopyOwner owner, org.eclipse.core.runtime.IProgressMonitor monitor) Creates and returns a type hierarchy for the given type considering subtypes in the specified region and considering types in the working copies with the given owner.newTypeHierarchy(IType type, IRegion region, org.eclipse.core.runtime.IProgressMonitor monitor) Creates and returns a type hierarchy for the given type considering subtypes in the specified region.String[]projectPrerequisites(IClasspathEntry[] resolvedClasspath) IClasspathEntry[][]readFileEntriesWithException(Map unknownElements) Reads the classpath file entries of this project's .classpath file.org.eclipse.core.runtime.IPathReturns the default output location for the project as defined by its.classpathfile from disk, ornullif unable to read the file.Returns the raw classpath for the project as defined by its.classpathfile from disk, ornullif unable to read the file.static voidvoidresolveClasspath(IClasspathEntry[] rawClasspath) org.aspectj.org.eclipse.jdt.internal.core.JavaProject.ResolvedClasspathresolveClasspath(IClasspathEntry[] rawClasspath, boolean usePreviousSession, boolean resolveChainedLibraries) org.aspectj.org.eclipse.jdt.internal.core.JavaProject.ResolvedClasspathresolveClasspath(IClasspathEntry[] rawClasspath, IClasspathEntry[] referencedEntries, boolean usePreviousSession, boolean resolveChainedLibraries) voidresolveClasspath(JavaModelManager.PerProjectInfo perProjectInfo, boolean usePreviousSession, boolean addClasspathChange) org.eclipse.core.resources.IResourceresource(PackageFragmentRoot root) rootID()Answers an ID which is used to distinguish project/entries during package fragment root computationsvoidvoidHelper method for setting one option value only.voidsetOptions(Map<String, String> newOptions) Sets the project custom options.voidsetOutputLocation(org.eclipse.core.runtime.IPath path, org.eclipse.core.runtime.IProgressMonitor monitor) Sets the default output location of this project to the location described by the given workspace-relative absolute path.voidsetRawClasspath(IClasspathEntry[] entries, boolean canModifyResources, org.eclipse.core.runtime.IProgressMonitor monitor) Sets the classpath of this project using a list of classpath entries.protected voidsetRawClasspath(IClasspathEntry[] newRawClasspath, IClasspathEntry[] referencedEntries, org.eclipse.core.runtime.IPath newOutputLocation, boolean canModifyResources, org.eclipse.core.runtime.IProgressMonitor monitor) voidsetRawClasspath(IClasspathEntry[] entries, IClasspathEntry[] referencedEntries, org.eclipse.core.runtime.IPath outputLocation, org.eclipse.core.runtime.IProgressMonitor monitor) Works similar toIJavaProject.setRawClasspath(IClasspathEntry[], IPath, IProgressMonitor)and additionally allows persisting the given array of referenced entries for this project.voidsetRawClasspath(IClasspathEntry[] newRawClasspath, org.eclipse.core.runtime.IPath newOutputLocation, boolean canModifyResources, org.eclipse.core.runtime.IProgressMonitor monitor) Sets both the classpath of this project and its default output location at once.voidsetRawClasspath(IClasspathEntry[] entries, org.eclipse.core.runtime.IPath outputLocation, org.eclipse.core.runtime.IProgressMonitor monitor) Sets the both the classpath of this project and its default output location at once.voidsetRawClasspath(IClasspathEntry[] entries, org.eclipse.core.runtime.IProgressMonitor monitor) Sets the classpath of this project using a list of classpath entries.voidsetSharedProperty(String key, String value) Record a shared persistent property onto a project.voidupdateCycleParticipants(List<org.eclipse.core.runtime.IPath> prereqChain, LinkedHashSet<org.eclipse.core.runtime.IPath> cycleParticipants, Map<org.eclipse.core.runtime.IPath, List<org.aspectj.org.eclipse.jdt.internal.core.JavaProject.CycleInfo>> cyclesPerProject, org.eclipse.core.resources.IWorkspaceRoot workspaceRoot, HashSet traversed, Map preferredClasspaths) If a cycle is detected, then cycleParticipants contains all the paths of projects involved in this cycle (directly and indirectly), no cycle if the set is empty (and started empty)static voidvalidateCycles(Map preferredClasspaths) booleanwriteFileEntries(IClasspathEntry[] newClasspath, IClasspathEntry[] referencedEntries, org.eclipse.core.runtime.IPath newOutputLocation) Writes the classpath in a sharable format (VCM-wise) only when necessary, that is, if it is semantically different from the existing one in file.booleanwriteFileEntries(IClasspathEntry[] newClasspath, org.eclipse.core.runtime.IPath newOutputLocation) Methods inherited from class Openable
bufferChanged, canBeRemovedFromCache, canBufferBeRemovedFromCache, closeBuffer, closing, codeComplete, codeSelect, findRecommendedLineSeparator, generateInfos, getBuffer, getBufferFactory, getBufferManager, getCorrespondingResource, getOpenable, getPackageFragmentRoot, getResource, hasBuffer, hasUnsavedChanges, ignoreErrorStatus, isConsistent, isOpen, isSourceElement, isStructureKnown, makeConsistent, open, openAncestors, openBuffer, resource, resourceExists, saveModifier and TypeMethodDescriptionvoidbufferChanged(BufferChangedEvent event) The buffer associated with this element has changed.booleanbooleancanBufferBeRemovedFromCache(IBuffer buffer) protected voidClose the buffer associated with this element, if any.protected voidThis element is being closed.protected voidcodeComplete(ICompilationUnit cu, ICompilationUnit unitToSkip, int position, CompletionRequestor requestor, WorkingCopyOwner owner, ITypeRoot typeRoot, org.eclipse.core.runtime.IProgressMonitor monitor) protected IJavaElement[]codeSelect(ICompilationUnit cu, int offset, int length, WorkingCopyOwner owner) Finds and returns the recommended line separator for this element.protected voidgenerateInfos(IElementInfo info, Map<IJavaElement, IElementInfo> newElements, org.eclipse.core.runtime.IProgressMonitor monitor) Generates the element infos for this element, its ancestors (if they are not opened) and its children (if it is an Openable).Note: a buffer with no unsaved changes can be closed by the Java Model since it has a finite number of buffers allowed open at one time.Deprecated.protected BufferManagerReturns the buffer manager for this element.org.eclipse.core.resources.IResourceReturn my underlying resource.Returns the first openable parent.Find enclosing package fragment root if anyorg.eclipse.core.resources.IResourceReturns the innermost resource enclosing this element.protected booleanReturns true if this element may have an associated source buffer, otherwise false.booleanReturnstrueif this element is open and: its buffer has unsaved changes, or one of its descendants has unsaved changes, or a working copy has been created on one of this element's children and has not yet destroyedprotected booleanignoreErrorStatus(org.eclipse.core.runtime.IStatus status) booleanSubclasses must override as required.booleanisOpen()Returns whether this openable is open.protected booleanReturns true if this represents a source element.booleanReturns whether the structure of this element is known.voidmakeConsistent(org.eclipse.core.runtime.IProgressMonitor monitor) Makes this element consistent with its underlying resource or buffer by updating the element's structure and properties as necessary.voidopen(org.eclipse.core.runtime.IProgressMonitor pm) Opens this element and all parent elements that are not already open.protected voidopenAncestors(Map<IJavaElement, IElementInfo> newElements, org.eclipse.core.runtime.IProgressMonitor monitor) protected IBufferopenBuffer(org.eclipse.core.runtime.IProgressMonitor pm, IElementInfo info) Opens a buffer on the contents of this element, and returns the buffer, or returnsnullif opening fails.org.eclipse.core.resources.IResourceresource()protected booleanresourceExists(org.eclipse.core.resources.IResource underlyingResource) Returns whether the corresponding resource or associated file existsvoidsave(org.eclipse.core.runtime.IProgressMonitor pm, boolean force) Saves any changes in this element's buffer to its underlying resource via a workspace resource operation.Methods inherited from class JavaElement
appendEscapedDelimiter, escapeMementoName, findNode, getAncestor, getAttachedJavadoc, getChildren, getChildrenOfType, getClassFile, getCompilationUnit, getElementInfo, getElementInfo, getHandleFromMemento, getHandleIdentifier, getHandleMemento, getHandleMemento, getJavadocBaseLocation, getLibraryJavadocLocation, getOpenableParent, getParent, getPrimaryElement, getPrimaryElement, getSchedulingRule, getSourceElementAt, getURLContents, hasChildren, hashCode, isAncestorOf, isReadOnly, newDoesNotExistStatus, newJavaModelException, newNotPresentException, openWhenClosed, readableName, resetHashCode, resolved, tabString, toDebugString, toString, toString, toStringAncestors, toStringChildren, toStringInfo, toStringInfo, toStringName, toStringWithAncestors, toStringWithAncestors, unresolved, validateAndCacheModifier and TypeMethodDescriptionprotected voidappendEscapedDelimiter(StringBuilder buffer, char delimiter) protected voidescapeMementoName(StringBuilder buffer, String mementoName) findNode(CompilationUnit ast) Returns theASTNodethat corresponds to thisJavaElementornullif there is no corresponding node.getAncestor(int ancestorType) Returns this Java element or the first ancestor of this element that has the given type.getAttachedJavadoc(org.eclipse.core.runtime.IProgressMonitor monitor) Returns the Javadoc as HTML source if this element has attached Javadoc,nullotherwise.getChildrenOfType(int type) Returns a collection of (immediate) children of this node of the specified type.Returns the info for this handle.getElementInfo(org.eclipse.core.runtime.IProgressMonitor monitor) Returns the info for this handle.getHandleFromMemento(MementoTokenizer memento, WorkingCopyOwner owner) Returns a string representation of this element handle.protected voidprotected URLprotected static URLReturn the first instance of IOpenable in the parent hierarchy of this element.Returns the element directly containing this element, ornullif this element has no parent.Returns the primary element (whose compilation unit is the primary compilation unit) this working copy element was created from, or this element if it is a descendant of a primary compilation unit or if it is not a descendant of a working copy (e.g.getPrimaryElement(boolean checkOwner) org.eclipse.core.runtime.jobs.ISchedulingRuleReturns the scheduling rule associated with this Java element.protected IJavaElementgetSourceElementAt(int position) Returns the element that is located at the given source position in this element.protected StringgetURLContents(URL baseLoc, String docUrlValue) booleanfinal inthashCode()Returns the hash code for this Java element.booleanReturns true if this element is an ancestor of the given element, otherwise false.booleanReturns whether this Java element is read-only.protected JavaModelStatusnewJavaModelException(org.eclipse.core.runtime.IStatus status) Creates and returns a new Java model exception for this element with the given status.Creates and returns a new not present exception for this element.protected IElementInfoopenWhenClosed(IElementInfo info, boolean forceAdd, org.eclipse.core.runtime.IProgressMonitor monitor) protected voidshould not be needed but some implementations do have mutable member "occurrenceCount"protected StringtabString(int tab) Debugging purposestoString()Debugging purposesprotected voidtoString(int tab, StringBuilder buffer) Debugging purposesprotected voidtoStringAncestors(StringBuilder buffer) Debugging purposesprotected voidtoStringChildren(int tab, StringBuilder buffer, Object info) Debugging purposestoStringInfo(int tab, StringBuilder buffer) Debugging purposesprotected voidtoStringInfo(int tab, StringBuilder buffer, Object info, boolean showResolvedInfo) Debugging purposesprotected voidtoStringName(StringBuilder buffer) Debugging purposesDebugging purposestoStringWithAncestors(boolean showResolvedInfo) Debugging purposesprotected voidvalidateAndCache(URL baseLoc, FileNotFoundException e) Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapterMethods inherited from interface IParent
getChildren, hasChildrenModifier and TypeMethodDescriptionReturns the immediate children of this element.booleanReturns whether this element has one or more immediate children.
-
Field Details
-
EXTERNAL_PROJECT_NAME
- See Also:
-
-
Constructor Details
-
ExternalJavaProject
-
-
Method Details
-
equals
Description copied from class:JavaProjectReturns true if this handle represents the same Java project as the given handle. Two handles represent the same project if they are identical or if they represent a project with the same underlying resource and occurrence counts.- Overrides:
equalsin classJavaProject- See Also:
-
exists
public boolean exists()Description copied from interface:IJavaElementReturns whether this Java element exists in the model.Java elements are handle objects that may or may not be backed by an actual element. Java elements that are backed by an actual element are said to "exist", and this method returns
true. For Java elements that are not working copies, it is always the case that if the element exists, then its parent also exists (provided it has one) and includes the element as one of its children. It is therefore possible to navigated to any existing Java element from the root of the Java model along a chain of existing Java elements. On the other hand, working copies are said to exist until they are destroyed (withIWorkingCopy.destroy). Unlike regular Java elements, a working copy never shows up among the children of its parent element (which may or may not exist).- Specified by:
existsin interfaceIJavaElement- Overrides:
existsin classOpenable- Returns:
trueif this element exists in the Java model, andfalseif this element does not exist- See Also:
-
getOption
Description copied from interface:IJavaProjectHelper method for returning one option value only. Equivalent to(String)this.getOptions(inheritJavaCoreOptions).get(optionName)Note that it may answernullif this option does not exist, or if there is no custom value for it.For a complete description of the configurable options, see
JavaCore#getDefaultOptions.- Specified by:
getOptionin interfaceIJavaProject- Overrides:
getOptionin classJavaProject- Parameters:
optionName- the name of an optioninheritJavaCoreOptions- - boolean indicating whether JavaCore options should be inherited as well- Returns:
- the String value of a given option
- See Also:
-
isOnClasspath
Description copied from interface:IJavaProjectReturns whether the given element is on the classpath of this project, that is, referenced from a classpath entry and not explicitly excluded using an exclusion pattern.- Specified by:
isOnClasspathin interfaceIJavaProject- Overrides:
isOnClasspathin classJavaProject- Parameters:
element- the given element- Returns:
trueif the given element is on the classpath of this project,falseotherwise- See Also:
-
isOnClasspath
public boolean isOnClasspath(org.eclipse.core.resources.IResource resource) Description copied from interface:IJavaProjectReturns whether the given resource is on the classpath of this project, that is, referenced from a classpath entry and not explicitly excluded using an exclusion pattern.- Specified by:
isOnClasspathin interfaceIJavaProject- Overrides:
isOnClasspathin classJavaProject- Parameters:
resource- the given resource- Returns:
trueif the given resource is on the classpath of this project,falseotherwise- See Also:
-
validateExistence
protected org.eclipse.core.runtime.IStatus validateExistence(org.eclipse.core.resources.IResource underlyingResource) - Overrides:
validateExistencein classJavaProject
-