Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2006 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2007 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 15-21
Link Here
|
15 |
/** |
15 |
/** |
16 |
* An entry on a Java project classpath identifying one or more package fragment |
16 |
* An entry on a Java project classpath identifying one or more package fragment |
17 |
* roots. A classpath entry has a content kind (either source, |
17 |
* roots. A classpath entry has a content kind (either source, |
18 |
* <code>K_SOURCE</code>, or binary, <code>K_BINARY</code>), which is inherited |
18 |
* {@link IPackageFragmentRoot#K_SOURCE}, or binary, {@link IPackageFragmentRoot#K_BINARY}), which is inherited |
19 |
* by each package fragment root and package fragment associated with the entry. |
19 |
* by each package fragment root and package fragment associated with the entry. |
20 |
* <p> |
20 |
* <p> |
21 |
* A classpath entry can refer to any of the following:<ul> |
21 |
* A classpath entry can refer to any of the following:<ul> |
Lines 29-35
Link Here
|
29 |
* represent compilation units. All compilation units will be compiled when |
29 |
* represent compilation units. All compilation units will be compiled when |
30 |
* the project is built. The classpath entry must specify the |
30 |
* the project is built. The classpath entry must specify the |
31 |
* absolute path to the root folder. Entries of this kind are |
31 |
* absolute path to the root folder. Entries of this kind are |
32 |
* associated with the <code>CPE_SOURCE</code> constant. |
32 |
* associated with the {@link #CPE_SOURCE} constant. |
33 |
* Source classpath entries can carry inclusion and exclusion patterns for |
33 |
* Source classpath entries can carry inclusion and exclusion patterns for |
34 |
* selecting which source files appear as compilation |
34 |
* selecting which source files appear as compilation |
35 |
* units and get compiled when the project is built. |
35 |
* units and get compiled when the project is built. |
Lines 40-46
Link Here
|
40 |
* package fragments and <code>.class</code> files. The classpath entry |
40 |
* package fragments and <code>.class</code> files. The classpath entry |
41 |
* must specify the absolute path to the JAR (or root folder), and in case it refers |
41 |
* must specify the absolute path to the JAR (or root folder), and in case it refers |
42 |
* to an external JAR, then there is no associated resource in the workbench. Entries |
42 |
* to an external JAR, then there is no associated resource in the workbench. Entries |
43 |
* of this kind are associated with the <code>CPE_LIBRARY</code> constant.</li> |
43 |
* of this kind are associated with the {@link #CPE_LIBRARY} constant.</li> |
44 |
* |
44 |
* |
45 |
* <li>A required project. In this case the entry identifies another project in |
45 |
* <li>A required project. In this case the entry identifies another project in |
46 |
* the workspace. The required project is used as a binary library when compiling |
46 |
* the workspace. The required project is used as a binary library when compiling |
Lines 51-100
Link Here
|
51 |
* is performed against a required project's source code, and compilation is |
51 |
* is performed against a required project's source code, and compilation is |
52 |
* performed against a required project's last built state. The |
52 |
* performed against a required project's last built state. The |
53 |
* classpath entry must specify the absolute path to the |
53 |
* classpath entry must specify the absolute path to the |
54 |
* project. Entries of this kind are associated with the <code>CPE_PROJECT</code> |
54 |
* project. Entries of this kind are associated with the {@link #CPE_PROJECT} |
55 |
* constant. |
55 |
* constant. |
56 |
* Note: referencing a required project with a classpath entry refers to the source |
56 |
* Note: referencing a required project with a classpath entry refers to the source |
57 |
* code or associated <code>.class</code> files located in its output location. |
57 |
* code or associated <code>.class</code> files located in its output location. |
58 |
* It will also automatically include any other libraries or projects that the required project's classpath |
58 |
* It will also automatically include any other libraries or projects that the required project's classpath |
59 |
* refers to, iff the corresponding classpath entries are tagged as being exported |
59 |
* refers to, iff the corresponding classpath entries are tagged as being exported |
60 |
* (<code>IClasspathEntry#isExported</code>). |
60 |
* ({@link IClasspathEntry#isExported}). |
61 |
* Unless exporting some classpath entries, classpaths are not chained by default - |
61 |
* Unless exporting some classpath entries, classpaths are not chained by default - |
62 |
* each project must specify its own classpath in its entirety.</li> |
62 |
* each project must specify its own classpath in its entirety.</li> |
63 |
* |
63 |
* |
64 |
* <li> A path beginning in a classpath variable defined globally to the workspace. |
64 |
* <li> A path beginning in a classpath variable defined globally to the workspace. |
65 |
* Entries of this kind are associated with the <code>CPE_VARIABLE</code> constant. |
65 |
* Entries of this kind are associated with the {@link #CPE_VARIABLE} constant. |
66 |
* Classpath variables are created using <code>JavaCore#setClasspathVariable</code>, |
66 |
* Classpath variables are created using {@link JavaCore#setClasspathVariable(String, IPath, org.eclipse.core.runtime.IProgressMonitor)}, |
67 |
* and gets resolved, to either a project or library entry, using |
67 |
* and gets resolved, to either a project or library entry, using |
68 |
* <code>JavaCore#getResolvedClasspathVariable</code>. |
68 |
* {@link JavaCore#getResolvedClasspathEntry(IClasspathEntry)}. |
69 |
* It is also possible to register an automatic initializer (<code>ClasspathVariableInitializer</code>), |
69 |
* It is also possible to register an automatic initializer ({@link ClasspathVariableInitializer}), |
70 |
* which will be invoked through the extension point "org.eclipse.jdt.core.classpathVariableInitializer". |
70 |
* which will be invoked through the extension point "org.eclipse.jdt.core.classpathVariableInitializer". |
71 |
* After resolution, a classpath variable entry may either correspond to a project or a library entry. </li> |
71 |
* After resolution, a classpath variable entry may either correspond to a project or a library entry. </li> |
72 |
* |
72 |
* |
73 |
* <li> A named classpath container identified by its container path. |
73 |
* <li> A named classpath container identified by its container path. |
74 |
* A classpath container provides a way to indirectly reference a set of classpath entries through |
74 |
* A classpath container provides a way to indirectly reference a set of classpath entries through |
75 |
* a classpath entry of kind <code>CPE_CONTAINER</code>. Typically, a classpath container can |
75 |
* a classpath entry of kind {@link #CPE_CONTAINER}. Typically, a classpath container can |
76 |
* be used to describe a complex library composed of multiple JARs, projects or classpath variables, |
76 |
* be used to describe a complex library composed of multiple JARs, projects or classpath variables, |
77 |
* considering also that containers can be mapped differently on each project. Several projects can |
77 |
* considering also that containers can be mapped differently on each project. Several projects can |
78 |
* reference the same generic container path, but have each of them actually bound to a different |
78 |
* reference the same generic container path, but have each of them actually bound to a different |
79 |
* container object. |
79 |
* container object. |
80 |
* The container path is a formed by a first ID segment followed with extra segments, |
80 |
* The container path is a formed by a first ID segment followed with extra segments, |
81 |
* which can be used as additional hints for resolving this container reference. If no container was ever |
81 |
* which can be used as additional hints for resolving this container reference. If no container was ever |
82 |
* recorded for this container path onto this project (using <code>setClasspathContainer</code>, |
82 |
* recorded for this container path onto this project (using {@link JavaCore#setClasspathContainer}, |
83 |
* then a <code>ClasspathContainerInitializer</code> will be activated if any was registered for this |
83 |
* then a {@link ClasspathContainerInitializer} will be activated if any was registered for this |
84 |
* container ID onto the extension point "org.eclipse.jdt.core.classpathContainerInitializer". |
84 |
* container ID onto the extension point "org.eclipse.jdt.core.classpathContainerInitializer". |
85 |
* A classpath container entry can be resolved explicitly using <code>JavaCore#getClasspathContainer</code> |
85 |
* A classpath container entry can be resolved explicitly using {@link JavaCore#getClasspathContainer} |
86 |
* and the resulting container entries can contain any non-container entry. In particular, it may contain variable |
86 |
* and the resulting container entries can contain any non-container entry. In particular, it may contain variable |
87 |
* entries, which in turn needs to be resolved before being directly used. |
87 |
* entries, which in turn needs to be resolved before being directly used. |
88 |
* <br> Also note that the container resolution APIs include an IJavaProject argument, so as to allow the same |
88 |
* <br> Also note that the container resolution APIs include an IJavaProject argument, so as to allow the same |
89 |
* container path to be interpreted in different ways for different projects. </li> |
89 |
* container path to be interpreted in different ways for different projects. </li> |
90 |
* </ul> |
90 |
* </ul> |
91 |
* </p> |
91 |
* </p> |
92 |
* The result of <code>IJavaProject#getResolvedClasspath</code> will have all entries of type |
92 |
* The result of {@link IJavaProject#getResolvedClasspath} will have all entries of type |
93 |
* <code>CPE_VARIABLE</code> and <code>CPE_CONTAINER</code> resolved to a set of |
93 |
* {@link #CPE_VARIABLE} and {@link #CPE_CONTAINER} resolved to a set of |
94 |
* <code>CPE_SOURCE</code>, <code>CPE_LIBRARY</code> or <code>CPE_PROJECT</code> |
94 |
* {@link #CPE_SOURCE}, {@link #CPE_LIBRARY} or {@link #CPE_PROJECT} |
95 |
* classpath entries. |
95 |
* classpath entries. |
96 |
* <p> |
96 |
* <p> |
97 |
* Any classpath entry other than a source folder (kind <code>CPE_SOURCE</code>) can |
97 |
* Any classpath entry other than a source folder (kind {@link #CPE_SOURCE}) can |
98 |
* be marked as being exported. Exported entries are automatically contributed to |
98 |
* be marked as being exported. Exported entries are automatically contributed to |
99 |
* dependent projects, along with the project's default output folder, which is |
99 |
* dependent projects, along with the project's default output folder, which is |
100 |
* implicitly exported, and any auxiliary output folders specified on source |
100 |
* implicitly exported, and any auxiliary output folders specified on source |
Lines 102-108
Link Here
|
102 |
* followed by the any exported entries. |
102 |
* followed by the any exported entries. |
103 |
* <p> |
103 |
* <p> |
104 |
* This interface is not intended to be implemented by clients. |
104 |
* This interface is not intended to be implemented by clients. |
105 |
* Classpath entries can be created via methods on <code>JavaCore</code>. |
105 |
* Classpath entries can be created via methods on {@link JavaCore}. |
106 |
* </p> |
106 |
* </p> |
107 |
* |
107 |
* |
108 |
* @see JavaCore#newLibraryEntry(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath) |
108 |
* @see JavaCore#newLibraryEntry(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath) |
Lines 170-180
Link Here
|
170 |
* Returns the kind of files found in the package fragments identified by this |
170 |
* Returns the kind of files found in the package fragments identified by this |
171 |
* classpath entry. |
171 |
* classpath entry. |
172 |
* |
172 |
* |
173 |
* @return <code>IPackageFragmentRoot.K_SOURCE</code> for files containing |
173 |
* @return {@link IPackageFragmentRoot#K_SOURCE} for files containing |
174 |
* source code, and <code>IPackageFragmentRoot.K_BINARY</code> for binary |
174 |
* source code, and {@link IPackageFragmentRoot#K_BINARY} for binary |
175 |
* class files. |
175 |
* class files. |
176 |
* There is no specified value for an entry denoting a variable (<code>CPE_VARIABLE</code>) |
176 |
* There is no specified value for an entry denoting a variable ({@link #CPE_VARIABLE}) |
177 |
* or a classpath container (<code>CPE_CONTAINER</code>). |
177 |
* or a classpath container ({@link #CPE_CONTAINER}). |
178 |
*/ |
178 |
*/ |
179 |
int getContentKind(); |
179 |
int getContentKind(); |
180 |
|
180 |
|
Lines 183-198
Link Here
|
183 |
* |
183 |
* |
184 |
* @return one of: |
184 |
* @return one of: |
185 |
* <ul> |
185 |
* <ul> |
186 |
* <li><code>CPE_SOURCE</code> - this entry describes a source root in |
186 |
* <li>{@link #CPE_SOURCE} - this entry describes a source root in |
187 |
its project |
187 |
its project |
188 |
* <li><code>CPE_LIBRARY</code> - this entry describes a folder or JAR |
188 |
* <li>{@link #CPE_LIBRARY} - this entry describes a folder or JAR |
189 |
containing binaries |
189 |
containing binaries |
190 |
* <li><code>CPE_PROJECT</code> - this entry describes another project |
190 |
* <li>{@link #CPE_PROJECT} - this entry describes another project |
191 |
* |
191 |
* |
192 |
* <li><code>CPE_VARIABLE</code> - this entry describes a project or library |
192 |
* <li>{@link #CPE_VARIABLE} - this entry describes a project or library |
193 |
* indirectly via a classpath variable in the first segment of the path |
193 |
* indirectly via a classpath variable in the first segment of the path |
194 |
* * |
194 |
* * |
195 |
* <li><code>CPE_CONTAINER</code> - this entry describes set of entries |
195 |
* <li>{@link #CPE_CONTAINER} - this entry describes set of entries |
196 |
* referenced indirectly via a classpath container |
196 |
* referenced indirectly via a classpath container |
197 |
* </ul> |
197 |
* </ul> |
198 |
*/ |
198 |
*/ |
Lines 344-354
Link Here
|
344 |
/** |
344 |
/** |
345 |
* Returns the full path to the specific location where the builder writes |
345 |
* Returns the full path to the specific location where the builder writes |
346 |
* <code>.class</code> files generated for this source entry |
346 |
* <code>.class</code> files generated for this source entry |
347 |
* (entry kind <code>CPE_SOURCE</code>). |
347 |
* (entry kind {@link #CPE_SOURCE}). |
348 |
* <p> |
348 |
* <p> |
349 |
* Source entries can optionally be associated with a specific output location. |
349 |
* Source entries can optionally be associated with a specific output location. |
350 |
* If none is provided, the source entry will be implicitly associated with its project |
350 |
* If none is provided, the source entry will be implicitly associated with its project |
351 |
* default output location (see <code>IJavaProject#getOutputLocation</code>). |
351 |
* default output location (see {@link IJavaProject#getOutputLocation}). |
352 |
* </p><p> |
352 |
* </p><p> |
353 |
* NOTE: A specific output location cannot coincidate with another source/library entry. |
353 |
* NOTE: A specific output location cannot coincidate with another source/library entry. |
354 |
* </p> |
354 |
* </p> |
Lines 364-387
Link Here
|
364 |
* Returns the path of this classpath entry. |
364 |
* Returns the path of this classpath entry. |
365 |
* |
365 |
* |
366 |
* The meaning of the path of a classpath entry depends on its entry kind:<ul> |
366 |
* The meaning of the path of a classpath entry depends on its entry kind:<ul> |
367 |
* <li>Source code in the current project (<code>CPE_SOURCE</code>) - |
367 |
* <li>Source code in the current project ({@link #CPE_SOURCE}) - |
368 |
* The path associated with this entry is the absolute path to the root folder. </li> |
368 |
* The path associated with this entry is the absolute path to the root folder. </li> |
369 |
* <li>A binary library in the current project (<code>CPE_LIBRARY</code>) - the path |
369 |
* <li>A binary library in the current project ({@link #CPE_LIBRARY}) - the path |
370 |
* associated with this entry is the absolute path to the JAR (or root folder), and |
370 |
* associated with this entry is the absolute path to the JAR (or root folder), and |
371 |
* in case it refers to an external JAR, then there is no associated resource in |
371 |
* in case it refers to an external JAR, then there is no associated resource in |
372 |
* the workbench. |
372 |
* the workbench. |
373 |
* <li>A required project (<code>CPE_PROJECT</code>) - the path of the entry denotes the |
373 |
* <li>A required project ({@link #CPE_PROJECT}) - the path of the entry denotes the |
374 |
* path to the corresponding project resource.</li> |
374 |
* path to the corresponding project resource.</li> |
375 |
* <li>A variable entry (<code>CPE_VARIABLE</code>) - the first segment of the path |
375 |
* <li>A variable entry ({@link #CPE_VARIABLE}) - the first segment of the path |
376 |
* is the name of a classpath variable. If this classpath variable |
376 |
* is the name of a classpath variable. If this classpath variable |
377 |
* is bound to the path <i>P</i>, the path of the corresponding classpath entry |
377 |
* is bound to the path <i>P</i>, the path of the corresponding classpath entry |
378 |
* is computed by appending to <i>P</i> the segments of the returned |
378 |
* is computed by appending to <i>P</i> the segments of the returned |
379 |
* path without the variable.</li> |
379 |
* path without the variable.</li> |
380 |
* <li> A container entry (<code>CPE_CONTAINER</code>) - the path of the entry |
380 |
* <li> A container entry ({@link #CPE_CONTAINER}) - the path of the entry |
381 |
* is the name of the classpath container, which can be bound indirectly to a set of classpath |
381 |
* is the name of the classpath container, which can be bound indirectly to a set of classpath |
382 |
* entries after resolution. The containerPath is a formed by a first ID segment followed with |
382 |
* entries after resolution. The containerPath is a formed by a first ID segment followed with |
383 |
* extra segments that can be used as additional hints for resolving this container |
383 |
* extra segments that can be used as additional hints for resolving this container |
384 |
* reference (also see <code>IClasspathContainer</code>). |
384 |
* reference (also see {@link IClasspathContainer}). |
385 |
* </li> |
385 |
* </li> |
386 |
* </ul> |
386 |
* </ul> |
387 |
* |
387 |
* |
Lines 410-416
Link Here
|
410 |
* Returns the path within the source archive or folder where package fragments |
410 |
* Returns the path within the source archive or folder where package fragments |
411 |
* are located. An empty path indicates that packages are located at |
411 |
* are located. An empty path indicates that packages are located at |
412 |
* the root of the source archive or folder. Returns a non-<code>null</code> value |
412 |
* the root of the source archive or folder. Returns a non-<code>null</code> value |
413 |
* if and only if <code>getSourceAttachmentPath</code> returns |
413 |
* if and only if {@link #getSourceAttachmentPath} returns |
414 |
* a non-<code>null</code> value. |
414 |
* a non-<code>null</code> value. |
415 |
* |
415 |
* |
416 |
* @return the path within the source archive or folder, or <code>null</code> if |
416 |
* @return the path within the source archive or folder, or <code>null</code> if |
Lines 421-427
Link Here
|
421 |
/** |
421 |
/** |
422 |
* Returns whether this entry is exported to dependent projects. |
422 |
* Returns whether this entry is exported to dependent projects. |
423 |
* Always returns <code>false</code> for source entries (kind |
423 |
* Always returns <code>false</code> for source entries (kind |
424 |
* <code>CPE_SOURCE</code>), which cannot be exported. |
424 |
* {@link #CPE_SOURCE}), which cannot be exported. |
425 |
* |
425 |
* |
426 |
* @return <code>true</code> if exported, and <code>false</code> otherwise |
426 |
* @return <code>true</code> if exported, and <code>false</code> otherwise |
427 |
* @since 2.0 |
427 |
* @since 2.0 |