public abstract class AbstractRuntimeClasspathEntry extends PlatformObject implements IRuntimeClasspathEntry2
Clients implementing runtime classpath entries must subclass this class.
ARCHIVE, BOOTSTRAP_CLASSES, CLASS_PATH, CONTAINER, MODULE_PATH, OTHER, PATCH_MODULE, PROJECT, STANDARD_CLASSES, USER_CLASSES, VARIABLE| Constructor and Description |
|---|
AbstractRuntimeClasspathEntry() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
abort(java.lang.String message,
java.lang.Throwable exception)
Throws an exception with the given message and underlying exception.
|
protected abstract 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.
|
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. |
IResource |
getResource()
Returns the resource associated with this entry, or
null
if none. |
IRuntimeClasspathEntry[] |
getRuntimeClasspathEntries()
Default implementation returns an empty collection.
|
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.
|
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. |
boolean |
isAutomodule()
Returns
true if the java project associated is an AutoModule. |
boolean |
isComposite()
Returns whether this classpath entry is composed of other entries.
|
void |
setClasspathProperty(int property)
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.
|
protected void |
setJavaProject(IJavaProject javaProject)
Sets the Java project associated with this 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetName, getRuntimeClasspathEntries, getTypeId, initializeFromgetTypepublic boolean isComposite()
IRuntimeClasspathEntry2isComposite in interface IRuntimeClasspathEntry2public IRuntimeClasspathEntry[] getRuntimeClasspathEntries() throws CoreException
CoreException - if computing the entries failsIRuntimeClasspathEntry2protected void abort(java.lang.String message,
java.lang.Throwable exception)
throws CoreException
message - error messageexception - underlying exception or null if noneCoreException - the new CoreExceptionpublic 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 mementoprotected abstract void buildMemento(org.w3c.dom.Document document,
org.w3c.dom.Element memento)
throws CoreException
document - XML documentmemento - element node for client specific attributesCoreException - if unable to create a mementopublic 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 IRuntimeClasspathEntrynullorg.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 IRuntimeClasspathEntrynullpublic 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 nonepublic 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 nonepublic IPath getSourceAttachmentRootPath()
IRuntimeClasspathEntrynull value
if and only if getSourceAttachmentPath returns
a non-null value.getSourceAttachmentRootPath in interface IRuntimeClasspathEntrynull if
not applicablepublic 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 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 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 void setClasspathProperty(int property)
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 IRuntimeClasspathEntryproperty - a classpat property constantpublic java.lang.String getLocation()
IRuntimeClasspathEntrynull if none, or if this entry is of type CONTAINER.getLocation in interface IRuntimeClasspathEntrynull if nonepublic java.lang.String getSourceAttachmentLocation()
IRuntimeClasspathEntrynull if none.getSourceAttachmentLocation in interface IRuntimeClasspathEntrynull if nonepublic java.lang.String getSourceAttachmentRootLocation()
IRuntimeClasspathEntrynull if none.getSourceAttachmentRootLocation in interface IRuntimeClasspathEntrynull if nonepublic 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 CONTAINERpublic IClasspathEntry getClasspathEntry()
IRuntimeClasspathEntrynull if none.
Since 3.0, this method may return null.
getClasspathEntry in interface IRuntimeClasspathEntrynullpublic 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 noneprotected void setJavaProject(IJavaProject javaProject)
javaProject - the Java project contextpublic 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