public class DefaultProjectClasspathEntry extends AbstractRuntimeClasspathEntry
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TYPE_ID |
ARCHIVE, BOOTSTRAP_CLASSES, CLASS_PATH, CONTAINER, MODULE_PATH, OTHER, PATCH_MODULE, PROJECT, STANDARD_CLASSES, USER_CLASSES, VARIABLE| Constructor and Description |
|---|
DefaultProjectClasspathEntry()
Default constructor need to instantiate extensions
|
DefaultProjectClasspathEntry(IJavaProject project)
Constructs a new classpath entry for the given project.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
adjustClasspathProperty(IRuntimeClasspathEntry r,
IClasspathEntry entry) |
protected void |
buildMemento(org.w3c.dom.Document document,
org.w3c.dom.Element memento)
Constructs a memento for this classpath entry in the given
document and element.
|
boolean |
equals(java.lang.Object obj) |
static void |
expandProject(IClasspathEntry projectEntry,
java.util.List<java.lang.Object> expandedPath,
java.util.List<IClasspathEntry> expanding,
boolean excludeTestCode,
boolean exportedEntriesOnly,
IJavaProject rootProject,
boolean isModularJVM)
Returns the transitive closure of classpath entries for the given project entry.
|
static void |
expandProjectInternal(IClasspathEntry projectEntry,
java.util.List<java.lang.Object> expandedPath,
java.util.Set<java.lang.Object> visitedEntries,
java.util.List<IClasspathEntry> expanding,
boolean excludeTestCode,
boolean exportedEntriesOnly,
IJavaProject rootProject,
boolean isModularJVM) |
java.lang.String |
getLocation()
Returns an absolute path in the local file system for this entry,
or
null if none, or if this entry is of type CONTAINER. |
java.lang.String |
getName()
Returns a human readable name for this classpath entry.
|
IPath |
getPath()
Returns the path associated with this entry, or
null
if none. |
protected IProject |
getProject() |
IResource |
getResource()
Returns the resource associated with this entry, or
null
if none. |
IRuntimeClasspathEntry[] |
getRuntimeClasspathEntries(ILaunchConfiguration configuration)
Returns the classpath entries this entry is composed of, or an
empty collection if this entry is not a composite entry.
|
int |
getType()
Returns this classpath entry's type.
|
java.lang.String |
getTypeId()
Returns the unique identifier of the extension that contributed
this classpath entry type, or
null if this classpath
entry type was not contributed. |
int |
hashCode() |
void |
initializeFrom(org.w3c.dom.Element memento)
Initializes this runtime classpath entry from the given memento.
|
boolean |
isComposite()
Returns whether this classpath entry is composed of other entries.
|
boolean |
isExportedEntriesOnly()
Returns whether the classpath computation only includes exported
entries in referenced projects.
|
void |
setExportedEntriesOnly(boolean exportedOnly)
Sets whether the runtime classpath computation should only
include exported entries in referenced projects.
|
abort, getClasspathEntry, getClasspathProperty, getExternalAnnotationsPath, getJavaProject, getMemento, getRuntimeClasspathEntries, getSourceAttachmentLocation, getSourceAttachmentPath, getSourceAttachmentRootLocation, getSourceAttachmentRootPath, getVariableName, isAutomodule, setClasspathProperty, setExternalAnnotationsPath, setJavaProject, setSourceAttachmentPath, setSourceAttachmentRootPathpublic static final java.lang.String TYPE_ID
public DefaultProjectClasspathEntry()
public DefaultProjectClasspathEntry(IJavaProject project)
project - Java projectprotected void buildMemento(org.w3c.dom.Document document,
org.w3c.dom.Element memento)
throws CoreException
AbstractRuntimeClasspathEntrybuildMemento in class AbstractRuntimeClasspathEntrydocument - XML documentmemento - element node for client specific attributesCoreException - if unable to create a mementopublic void initializeFrom(org.w3c.dom.Element memento)
throws CoreException
IRuntimeClasspathEntry2memento - memento created by a classpath entry of the same typeCoreException - if unable to initialize from the given mementopublic java.lang.String getTypeId()
IRuntimeClasspathEntry2null if this classpath
entry type was not contributed.null if this classpath
entry type was not contributedpublic int getType()
IRuntimeClasspathEntryPROJECTARCHIVEVARIABLECONTAINEROTHER
Since 3.0, a type of OTHER may be returned.
protected IProject getProject()
public java.lang.String getLocation()
IRuntimeClasspathEntrynull if none, or if this entry is of type CONTAINER.getLocation in interface IRuntimeClasspathEntrygetLocation in class AbstractRuntimeClasspathEntrynull if nonepublic IPath getPath()
IRuntimeClasspathEntrynull
if none. The format of the
path returned depends on this entry's type:
PROJECT - a workspace relative path to the associated
project.ARCHIVE - the absolute path of the associated archive,
which may or may not be in the workspace.VARIABLE - the path corresponding to the associated
classpath variable entry.CONTAINER - the path corresponding to the associated
classpath container variable entry.OTHER - the path returned is client defined.
Since 3.0, this method may return null.
getPath in interface IRuntimeClasspathEntrygetPath in class AbstractRuntimeClasspathEntrynullorg.eclipse.jdt.core.IClasspathEntry#getPath()public IResource getResource()
IRuntimeClasspathEntrynull
if none. A project, archive, or folder entry may be associated
with a resource.getResource in interface IRuntimeClasspathEntrygetResource in class AbstractRuntimeClasspathEntrynullpublic IRuntimeClasspathEntry[] getRuntimeClasspathEntries(ILaunchConfiguration configuration) throws CoreException
IRuntimeClasspathEntry2configuration - the context (launch configuration) in which
this runtime classpath entry is being queried for contained
entries, possibly nullCoreException - if unable to retrieve contained entriespublic static void expandProject(IClasspathEntry projectEntry,
java.util.List<java.lang.Object> expandedPath,
java.util.List<IClasspathEntry> expanding,
boolean excludeTestCode,
boolean exportedEntriesOnly,
IJavaProject rootProject,
boolean isModularJVM)
throws CoreException
projectEntry - project classpath entryexpandedPath - a list of entries already expanded, should be empty to begin, and contains the resultexpanding - a list of projects that have been or are currently being expanded (to detect cycles)excludeTestCode - if true, test dependencies will be excludedexportedEntriesOnly - if true, only add exported transitive dependenciesrootProject - the root project for which the classpath is computedisModularJVM - if jvm is java 9 or laterCoreException - if unable to expand the classpathpublic static void expandProjectInternal(IClasspathEntry projectEntry,
java.util.List<java.lang.Object> expandedPath,
java.util.Set<java.lang.Object> visitedEntries,
java.util.List<IClasspathEntry> expanding,
boolean excludeTestCode,
boolean exportedEntriesOnly,
IJavaProject rootProject,
boolean isModularJVM)
throws CoreException
CoreExceptionpublic static void adjustClasspathProperty(IRuntimeClasspathEntry r, IClasspathEntry entry)
public boolean isComposite()
IRuntimeClasspathEntry2isComposite in interface IRuntimeClasspathEntry2isComposite in class AbstractRuntimeClasspathEntrypublic java.lang.String getName()
IRuntimeClasspathEntry2public boolean equals(java.lang.Object obj)
public int hashCode()
public void setExportedEntriesOnly(boolean exportedOnly)
exportedOnly - if the runtime classpath computation should only
include exported entries in referenced projects.public boolean isExportedEntriesOnly()