public class RuntimeClasspathEntry extends java.lang.Object implements IRuntimeClasspathEntry
IRuntimeClasspathEntryARCHIVE, BOOTSTRAP_CLASSES, CLASS_PATH, CONTAINER, MODULE_PATH, OTHER, PATCH_MODULE, PROJECT, STANDARD_CLASSES, USER_CLASSES, VARIABLE| Constructor and Description |
|---|
RuntimeClasspathEntry(IClasspathEntry entry)
Constructs a new runtime classpath entry based on the
(build) classpath entry.
|
RuntimeClasspathEntry(IClasspathEntry entry,
int classpathProperty)
Constructs a new container entry in the context of the given project
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
abort(java.lang.String message,
java.lang.Throwable e)
Throws an internal error exception
|
protected boolean |
equal(java.lang.Object one,
java.lang.Object two)
Returns whether the given objects are equal, accounting for null
|
boolean |
equals(java.lang.Object obj) |
IClasspathEntry |
getClasspathEntry()
Returns a classpath entry equivalent to this runtime classpath entry,
or
null if none. |
int |
getClasspathProperty()
Returns a constant indicating where this entry should appear on the
runtime classpath by default.
|
IPath |
getExternalAnnotationsPath()
Returns the path to the external annotations file or directory, or
null
if no external annotations are associated with this classpath entry. |
IJavaProject |
getJavaProject()
Returns the Java project associated with this runtime classpath entry
or
null if none. |
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 |
getMemento()
Returns a memento for this classpath entry.
|
IPath |
getPath()
Returns the path associated with this entry, or
null
if none. |
protected IClasspathEntry |
getResolvedClasspathEntry()
Returns the resolved classpath entry associated with this runtime
entry, resolving if required.
|
IResource |
getResource()
Returns the resource associated with this entry, or
null
if none. |
protected IResource |
getResource(IPath path)
Returns the resource in the workspace associated with the given
absolute path, or
null if none. |
java.lang.String |
getSourceAttachmentLocation()
Returns an absolute path in the local file system for the source
attachment associated with this entry entry, or
null if none. |
IPath |
getSourceAttachmentPath()
Returns the path to the source archive associated with this
entry, or
null if this classpath entry has no
source attachment. |
java.lang.String |
getSourceAttachmentRootLocation()
Returns a path relative to this entry's source attachment path for the
root location containing source, or
null if none. |
IPath |
getSourceAttachmentRootPath()
Returns the path within the source archive where package fragments
are located.
|
int |
getType()
Returns this classpath entry's type.
|
java.lang.String |
getVariableName()
Returns the first segment of the path associated with this entry, or
null
if this entry is not of type VARIABLE or CONTAINER. |
int |
hashCode() |
boolean |
isAutomodule()
Returns
true if the java project associated is an AutoModule. |
protected boolean |
isEmpty(java.lang.String string) |
protected java.lang.String |
resolveToOSPath(IPath path)
Returns the OS path for the given absolute or workspace relative path
|
void |
setClasspathProperty(int location)
Sets whether this entry should appear on the bootstrap classpath,
the user classpath, or whether this entry is a standard bootstrap entry
that does not need to appear on the classpath.
|
void |
setExternalAnnotationsPath(IPath path)
Sets the path to the external annotations file or directory.
|
void |
setJavaProject(IJavaProject project)
Sets the Java project associated with this classpath entry.
|
void |
setSourceAttachmentPath(IPath path)
Sets the path to the source archive associated with this
entry, or
null if this classpath entry has no
source attachment. |
void |
setSourceAttachmentRootPath(IPath path)
Sets the path within the source archive where package fragments
are located.
|
java.lang.String |
toString() |
protected void |
updateClasspathEntry(IPath path,
IPath sourcePath,
IPath rootPath,
IPath annotationsPath)
Creates a new underlying classpath entry for this runtime classpath entry
with the given paths, due to a change in source attachment.
|
public RuntimeClasspathEntry(IClasspathEntry entry)
entry - the associated classpath entrypublic RuntimeClasspathEntry(IClasspathEntry entry,
int classpathProperty)
entry - classpath entryclasspathProperty - this entry's classpath propertyprotected void abort(java.lang.String message,
java.lang.Throwable e)
throws CoreException
message - the messagee - the errorCoreException - the new CoreExceptionpublic int getType()
IRuntimeClasspathEntryPROJECTARCHIVEVARIABLECONTAINEROTHER
Since 3.0, a type of OTHER may be returned.
getType in interface IRuntimeClasspathEntryIRuntimeClasspathEntry.getType()public IClasspathEntry getClasspathEntry()
IRuntimeClasspathEntrynull if none.
Since 3.0, this method may return null.
getClasspathEntry in interface IRuntimeClasspathEntrynullIRuntimeClasspathEntry.getClasspathEntry()public java.lang.String getMemento()
throws CoreException
IRuntimeClasspathEntry
Since 3.0, the memento for a contributed classpath entry (i.e. of type OTHER), must be in the form of an XML document, with the
following element structure:
<runtimeClasspathEntry id="exampleId">
<memento
key1="value1"
...>
</memento>
</runtimeClasspathEntry>
The id attribute is the unique identifier of the extension that contributed this runtime classpath entry type, via the extension
point org.eclipse.jdt.launching.runtimeClasspathEntries. The memento element will be used to initialize a restored
runtime classpath entry, via the method IRuntimeClasspathEntry2.initializeFrom(Element memento). The attributes of the
memento element are client defined.getMemento in interface IRuntimeClasspathEntryCoreException - if an exception occurs generating a mementoIRuntimeClasspathEntry.getMemento()public 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 IRuntimeClasspathEntrynullIRuntimeClasspathEntry.getPath()public IResource getResource()
IRuntimeClasspathEntrynull
if none. A project, archive, or folder entry may be associated
with a resource.getResource in interface IRuntimeClasspathEntrynullIRuntimeClasspathEntry.getResource()protected IResource getResource(IPath path)
null if none. The path may have
a device.path - absolute path, or nullnullpublic IPath getSourceAttachmentPath()
IRuntimeClasspathEntrynull if this classpath entry has no
source attachment.
Only archive and variable entries may have source attachments. For archive entries, the path (if present) locates a source archive. For variable entries, the path (if present) has an analogous form and meaning as the variable path, namely the first segment is the name of a classpath variable.
getSourceAttachmentPath in interface IRuntimeClasspathEntrynull if noneIRuntimeClasspathEntry.getSourceAttachmentPath()public void setSourceAttachmentPath(IPath path)
IRuntimeClasspathEntrynull if this classpath entry has no
source attachment.
Only archive and variable entries may have source attachments. For archive entries, the path refers to a source archive. For variable entries, the path has an analogous form and meaning as the variable path, namely the first segment is the name of a classpath variable.
Note that an empty path (Path.EMPTY) is considered
null.
setSourceAttachmentPath in interface IRuntimeClasspathEntrypath - the path to the source archive, or null if noneIRuntimeClasspathEntry.setSourceAttachmentPath(IPath)public IPath getExternalAnnotationsPath()
IRuntimeClasspathEntrynull
if no external annotations are associated with this classpath entry.getExternalAnnotationsPath in interface IRuntimeClasspathEntrynull
if not present.public void setExternalAnnotationsPath(IPath path)
IRuntimeClasspathEntrynull if no annotations are associated with this entry.setExternalAnnotationsPath in interface IRuntimeClasspathEntrypath - The file or directory holding external annotations.public IPath getSourceAttachmentRootPath()
IRuntimeClasspathEntrynull value
if and only if getSourceAttachmentPath returns
a non-null value.getSourceAttachmentRootPath in interface IRuntimeClasspathEntrynull if
not applicableIRuntimeClasspathEntry.getSourceAttachmentRootPath()public void setSourceAttachmentRootPath(IPath path)
IRuntimeClasspathEntry
Note that an empty path (Path.EMPTY) is considered
null.
setSourceAttachmentRootPath in interface IRuntimeClasspathEntrypath - root path within the source archive, or nullpublic void setClasspathProperty(int location)
IRuntimeClasspathEntrySTANDARD_CLASSES - a standard entry does not need to appear
on the runtime classpathBOOTSTRAP_CLASSES - a bootstrap entry should appear on the
boot pathUSER_CLASSES - a user entry should appear on the path
conatining user or application classessetClasspathProperty in interface IRuntimeClasspathEntrylocation - a classpat property constantIRuntimeClasspathEntry.setClasspathProperty(int)public int getClasspathProperty()
IRuntimeClasspathEntrySTANDARD_CLASSES - a standard entry does not need to appear
on the runtime classpathBOOTSTRAP_CLASSES - a bootstrap entry should appear on the
boot pathUSER_CLASSES - a user entry should appear on the path
containing user or application classesgetClasspathProperty in interface IRuntimeClasspathEntrypublic java.lang.String getLocation()
IRuntimeClasspathEntrynull if none, or if this entry is of type CONTAINER.getLocation in interface IRuntimeClasspathEntrynull if noneIRuntimeClasspathEntry.getLocation()protected java.lang.String resolveToOSPath(IPath path)
path - the pathpublic java.lang.String getVariableName()
IRuntimeClasspathEntrynull
if this entry is not of type VARIABLE or CONTAINER.getVariableName in interface IRuntimeClasspathEntrynull
if this entry is not of type VARIABLE or CONTAINERIRuntimeClasspathEntry.getVariableName()public boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(Object)protected boolean equal(java.lang.Object one,
java.lang.Object two)
one - the object to comparetwo - the object to compare topublic int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()public java.lang.String getSourceAttachmentLocation()
IRuntimeClasspathEntrynull if none.getSourceAttachmentLocation in interface IRuntimeClasspathEntrynull if noneIRuntimeClasspathEntry.getSourceAttachmentLocation()public java.lang.String getSourceAttachmentRootLocation()
IRuntimeClasspathEntrynull if none.getSourceAttachmentRootLocation in interface IRuntimeClasspathEntrynull if noneIRuntimeClasspathEntry.getSourceAttachmentRootLocation()protected void updateClasspathEntry(IPath path,
IPath sourcePath,
IPath rootPath,
IPath annotationsPath)
path - the pathsourcePath - the source pathrootPath - the root pathprotected IClasspathEntry getResolvedClasspathEntry()
IClasspathEntryprotected boolean isEmpty(java.lang.String string)
public java.lang.String toString()
toString in class java.lang.Objectpublic IJavaProject getJavaProject()
IRuntimeClasspathEntrynull if none. Runtime classpath entries of type
CONTAINER may be associated with a project for the
purposes of resolving the entries in a container.getJavaProject in interface IRuntimeClasspathEntrynull if nonepublic void setJavaProject(IJavaProject project)
project - Java projectpublic boolean isAutomodule()
IRuntimeClasspathEntrytrue if the java project associated is an AutoModule.isAutomodule in interface IRuntimeClasspathEntrytrue if the Java project associated is an AutoModule or false if not