Interface IRuntimeClasspathEntry
-
- All Known Subinterfaces:
IRuntimeClasspathEntry2
public interface IRuntimeClasspathEntryRepresents an entry on a runtime classpath. A runtime classpath entry may refer to one of the following:- A Java project (type
PROJECT) - a project entry refers to all of the built classes in a project, and resolves to the output location(s) of the associated Java project. - An archive (type
ARCHIVE) - an archive refers to a jar, zip, or folder in the workspace or in the local file system containing class files. An archive may have attached source. - A variable (type
VARIABLE) - a variable refers to a classpath variable, which may refer to a jar. - A library (type
CONTAINER) - a container refers to classpath container variable which refers to a collection of archives derived dynamically, on a per project basis. - A contributed classpath entry (type
OTHER) - a contributed classpath entry is an extension contributed by a plug-in. The resolution of a contributed classpath entry is client defined. SeeIRuntimeClasspathEntry2.
Clients may implement this interface for contributing a classpath entry type (i.e. type
OTHER). Note, contributed classpath entries are new in 3.0, and are only intended to be contributed by the Java debugger.- Since:
- 2.0
- See Also:
IRuntimeClasspathEntry2- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static intARCHIVEType identifier for archive entries.static intBOOTSTRAP_CLASSESClasspath property identifier for entries that should appear on the bootstrap path explicitly.static intCLASS_PATHClasspath property identifier for entries that should appear on the class path for modular project.static intCONTAINERType identifier for container entries.static intMODULE_PATHClasspath property identifier for entries that should appear on the module path for modular project.static intOTHERType identifier for contributed entries.static intPATCH_MODULEClasspath property identifier for entries that should appear as --patch-module argument for a modular project.static intPROJECTType identifier for project entries.static intSTANDARD_CLASSESClasspath property identifier for entries that appear on the bootstrap path by default.static intUSER_CLASSESClasspath property identifier for entries that should appear on the user classpath.static intVARIABLEType identifier for variable entries.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IClasspathEntrygetClasspathEntry()Returns a classpath entry equivalent to this runtime classpath entry, ornullif none.intgetClasspathProperty()Returns a constant indicating where this entry should appear on the runtime classpath by default.IPathgetExternalAnnotationsPath()Returns the path to the external annotations file or directory, ornullif no external annotations are associated with this classpath entry.IJavaProjectgetJavaProject()Returns the Java project associated with this runtime classpath entry ornullif none.StringgetLocation()Returns an absolute path in the local file system for this entry, ornullif none, or if this entry is of typeCONTAINER.StringgetMemento()Returns a memento for this classpath entry.IPathgetPath()Returns the path associated with this entry, ornullif none.IResourcegetResource()Returns the resource associated with this entry, ornullif none.StringgetSourceAttachmentLocation()Returns an absolute path in the local file system for the source attachment associated with this entry entry, ornullif none.IPathgetSourceAttachmentPath()Returns the path to the source archive associated with this entry, ornullif this classpath entry has no source attachment.StringgetSourceAttachmentRootLocation()Returns a path relative to this entry's source attachment path for the root location containing source, ornullif none.IPathgetSourceAttachmentRootPath()Returns the path within the source archive where package fragments are located.intgetType()Returns this classpath entry's type.StringgetVariableName()Returns the first segment of the path associated with this entry, ornullif this entry is not of typeVARIABLEorCONTAINER.booleanisAutomodule()Returnstrueif the java project associated is an AutoModule.voidsetClasspathProperty(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.voidsetExternalAnnotationsPath(IPath path)Sets the path to the external annotations file or directory.voidsetSourceAttachmentPath(IPath path)Sets the path to the source archive associated with this entry, ornullif this classpath entry has no source attachment.voidsetSourceAttachmentRootPath(IPath path)Sets the path within the source archive where package fragments are located.
-
-
-
Field Detail
-
PROJECT
static final int PROJECT
Type identifier for project entries.- See Also:
- Constant Field Values
-
ARCHIVE
static final int ARCHIVE
Type identifier for archive entries.- See Also:
- Constant Field Values
-
VARIABLE
static final int VARIABLE
Type identifier for variable entries.- See Also:
- Constant Field Values
-
CONTAINER
static final int CONTAINER
Type identifier for container entries.- See Also:
- Constant Field Values
-
OTHER
static final int OTHER
Type identifier for contributed entries.- Since:
- 3.0
- See Also:
- Constant Field Values
-
STANDARD_CLASSES
static final int STANDARD_CLASSES
Classpath property identifier for entries that appear on the bootstrap path by default.- See Also:
- Constant Field Values
-
BOOTSTRAP_CLASSES
static final int BOOTSTRAP_CLASSES
Classpath property identifier for entries that should appear on the bootstrap path explicitly.- See Also:
- Constant Field Values
-
USER_CLASSES
static final int USER_CLASSES
Classpath property identifier for entries that should appear on the user classpath.- See Also:
- Constant Field Values
-
MODULE_PATH
static final int MODULE_PATH
Classpath property identifier for entries that should appear on the module path for modular project.- Since:
- 3.10
- See Also:
- Constant Field Values
-
CLASS_PATH
static final int CLASS_PATH
Classpath property identifier for entries that should appear on the class path for modular project.- Since:
- 3.10
- See Also:
- Constant Field Values
-
PATCH_MODULE
static final int PATCH_MODULE
Classpath property identifier for entries that should appear as --patch-module argument for a modular project.- Since:
- 3.10
- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
int getType()
Returns this classpath entry's type. The type of a runtime classpath entry is identified by one of the following constants:PROJECTARCHIVEVARIABLECONTAINEROTHER
Since 3.0, a type of
OTHERmay be returned.- Returns:
- this classpath entry's type
-
getMemento
String getMemento() throws CoreException
Returns a memento for this classpath entry.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>Theidattribute is the unique identifier of the extension that contributed this runtime classpath entry type, via the extension pointorg.eclipse.jdt.launching.runtimeClasspathEntries. Themementoelement will be used to initialize a restored runtime classpath entry, via the methodIRuntimeClasspathEntry2.initializeFrom(Element memento). The attributes of themementoelement are client defined.- Returns:
- a memento for this classpath entry
- Throws:
CoreException- if an exception occurs generating a memento
-
getPath
IPath getPath()
Returns the path associated with this entry, ornullif 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.- Returns:
- the path associated with this entry, or
null - See Also:
IClasspathEntry.getPath()
-
getResource
IResource getResource()
Returns the resource associated with this entry, ornullif none. A project, archive, or folder entry may be associated with a resource.- Returns:
- the resource associated with this entry, or
null
-
getSourceAttachmentPath
IPath getSourceAttachmentPath()
Returns the path to the source archive associated with this entry, ornullif 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.
- Returns:
- the path to the source archive, or
nullif none
-
setSourceAttachmentPath
void setSourceAttachmentPath(IPath path)
Sets the path to the source archive associated with this entry, ornullif 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 considerednull.- Parameters:
path- the path to the source archive, ornullif none
-
getSourceAttachmentRootPath
IPath getSourceAttachmentRootPath()
Returns the path within the source archive where package fragments are located. An empty path indicates that packages are located at the root of the source archive. Returns a non-nullvalue if and only ifgetSourceAttachmentPathreturns a non-nullvalue.- Returns:
- root path within the source archive, or
nullif not applicable
-
setSourceAttachmentRootPath
void setSourceAttachmentRootPath(IPath path)
Sets the path within the source archive where package fragments are located. A root path indicates that packages are located at the root of the source archive. Only valid if a source attachment path is also specified.Note that an empty path (
Path.EMPTY) is considerednull.- Parameters:
path- root path within the source archive, ornull
-
getExternalAnnotationsPath
IPath getExternalAnnotationsPath()
Returns the path to the external annotations file or directory, ornullif no external annotations are associated with this classpath entry.- Returns:
- The path to the external annotations file or directory, or
nullif not present. - Since:
- 3.8
-
setExternalAnnotationsPath
void setExternalAnnotationsPath(IPath path)
Sets the path to the external annotations file or directory. It should be set tonullif no annotations are associated with this entry.- Parameters:
path- The file or directory holding external annotations.- Since:
- 3.8
-
getClasspathProperty
int getClasspathProperty()
Returns a constant indicating where this entry should appear on the runtime classpath by default. The value returned is one of the following:STANDARD_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 classes
- Returns:
- where this entry should appear on the runtime classpath
-
setClasspathProperty
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. The location is one of:STANDARD_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 classes
- Parameters:
location- a classpat property constant
-
getLocation
String getLocation()
Returns an absolute path in the local file system for this entry, ornullif none, or if this entry is of typeCONTAINER.- Returns:
- an absolute path in the local file system for this entry,
or
nullif none
-
getSourceAttachmentLocation
String getSourceAttachmentLocation()
Returns an absolute path in the local file system for the source attachment associated with this entry entry, ornullif none.- Returns:
- an absolute path in the local file system for the source
attachment associated with this entry entry, or
nullif none
-
getSourceAttachmentRootLocation
String getSourceAttachmentRootLocation()
Returns a path relative to this entry's source attachment path for the root location containing source, ornullif none.- Returns:
- a path relative to this entry's source attachment path for the
root location containing source, or
nullif none
-
getVariableName
String getVariableName()
Returns the first segment of the path associated with this entry, ornullif this entry is not of typeVARIABLEorCONTAINER.- Returns:
- the first segment of the path associated with this entry, or
nullif this entry is not of typeVARIABLEorCONTAINER
-
getClasspathEntry
IClasspathEntry getClasspathEntry()
Returns a classpath entry equivalent to this runtime classpath entry, ornullif none.Since 3.0, this method may return
null.- Returns:
- a classpath entry equivalent to this runtime classpath entry,
or
null - Since:
- 2.1
-
getJavaProject
IJavaProject getJavaProject()
Returns the Java project associated with this runtime classpath entry ornullif none. Runtime classpath entries of typeCONTAINERmay be associated with a project for the purposes of resolving the entries in a container.- Returns:
- the Java project associated with this runtime classpath entry
or
nullif none - Since:
- 3.0
-
isAutomodule
boolean isAutomodule()
Returnstrueif the java project associated is an AutoModule.- Returns:
trueif the Java project associated is an AutoModule orfalseif not- Since:
- 3.10
-
-