KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > launching > IRuntimeClasspathEntryResolver


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.launching;
12
13
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.debug.core.ILaunchConfiguration;
16 import org.eclipse.jdt.core.IClasspathEntry;
17 import org.eclipse.jdt.core.IJavaProject;
18
19 /**
20  * Resolves variable and/or container runtime classpath entries in
21  * the context of a launch configuration or Java project. A resolver can be declared
22  * as an extension (<code>org.eclipse.jdt.launching.runtimeClasspathEntryResolver</code>),
23  * or be registered with the <code>JavaRuntime</code> programmatically.
24  * <p>
25  * A resolver is registered for a specific classpath
26  * <code>VARIABLE</code> and/or <code>CONTAINER</code>. A resolver is
27  * consulted when a runtime classpath entry is needs to be resolved.
28  * </p>
29  * A resolver extension is defined in <code>plugin.xml</code>.
30  * Following is an example definition of a runtime classpath entry
31  * resolver extension.
32  * <pre>
33  * &lt;extension point="org.eclipse.jdt.launching.runtimeClasspathEntryResolvers"&gt;
34  * &lt;runtimeClasspathEntryResolver
35  * id="com.example.ExampleResolver"
36  * class="com.example.ExampleResolverImpl"
37  * variable="VAR_NAME"
38  * container="CONTAINER_ID"
39  * &lt;/runtimeClasspathEntryResolver&gt;
40  * &lt;/extension&gt;
41  * </pre>
42  * The attributes are specified as follows:
43  * <ul>
44  * <li><code>id</code> specifies a unique identifier for this extension.</li>
45  * <li><code>class</code> specifies the fully qualified name of the Java class
46  * that implements <code>IRuntimeClasspathEntryResolver</code>.</li>
47  * <li><code>variable</code> name of the classpath variable this resolver
48  * is registered for.</li>
49  * <li><code>container</code> identifier of the classpath container this
50  * resolver is registered for.</li>
51  * </ul>
52  * At least one of <code>variable</code> or <code>container</code> must be
53  * specified.
54  * </p>
55  * <p>
56  * Clients may implement this interface.
57  * </p>
58  * @since 2.0
59  */

60 public interface IRuntimeClasspathEntryResolver {
61     
62     /**
63      * Returns resolved runtime classpath entries for the given runtime classpath entry,
64      * in the context of the given launch configuration.
65      *
66      * @param entry runtime classpath entry to resolve, of type
67      * <code>VARIABLE</code> or <code>CONTAINTER</code>
68      * @param configuration the context in which the runtime classpath entry
69      * needs to be resolved
70      * @return resolved entries (zero or more)
71      * @exception CoreException if unable to resolve the entry
72      */

73     public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry, ILaunchConfiguration configuration) throws CoreException;
74     
75     /**
76      * Returns resolved runtime classpath entries for the given runtime classpath entry,
77      * in the context of the given Java project.
78      *
79      * @param entry runtime classpath entry to resolve, of type
80      * <code>VARIABLE</code> or <code>CONTAINTER</code>
81      * @param project context in which the runtime classpath entry
82      * needs to be resolved
83      * @return resolved entries (zero or more)
84      * @exception CoreException if unable to resolve the entry
85      */

86     public IRuntimeClasspathEntry[] resolveRuntimeClasspathEntry(IRuntimeClasspathEntry entry, IJavaProject project) throws CoreException;
87     
88     /**
89      * Returns a VM install associated with the given classpath entry,
90      * or <code>null</code> if none.
91      *
92      * @param entry classpath entry
93      * @return vm install associated with entry or <code>null</code> if none
94      * @exception CoreException if unable to resolve a VM
95      */

96     public IVMInstall resolveVMInstall(IClasspathEntry entry) throws CoreException;
97 }
98
Popular Tags