KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > runtime > ILibrary


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.core.runtime;
12
13 import org.eclipse.osgi.util.ManifestElement;
14 import org.osgi.framework.Constants;
15
16 /**
17  * A runtime library declared in a plug-in. Libraries contribute elements to the search path.
18  * These contributions are specified as a path to a directory or Jar file. This path is always
19  * considered to be relative to the containing plug-in.
20  * <p>
21  * Libraries are typed. The type is used to determine to which search path the library's
22  * contribution should be added. The valid types are: <code>CODE</code> and
23  * <code>RESOURCE</code>.
24  * </p><p>
25  * This interface is not intended to be implemented by clients.
26  * </p>
27  *
28  * @see IPluginDescriptor#getRuntimeLibraries()
29  * @deprecated
30  * In Eclipse 3.0 the plug-in classpath representation was changed. Clients of
31  * <code>ILibrary</code> are directed to the headers associated with the relevant bundle.
32  * In particular, the <code>Bundle-Classpath</code> header contains all available information
33  * about the classpath of a plug-in. Having retrieved the header, the {@link ManifestElement}
34  * helper class can be used to parse the value and discover the individual
35  * class path entries. The various header attributes are defined in {@link Constants}.
36  * <p>For example,
37  * <pre>
38  * String header = bundle.getHeaders().get(Constants.BUNDLE_CLASSPATH);
39  * ManifestElement[] elements = ManifestElement.parseHeader(
40  * Constants.BUNDLE_CLASSPATH, header);
41  * if (elements == null)
42  * return;
43  * elements[0].getValue(); // the jar/dir containing the code
44  * ...
45  * </pre>
46  * </p><p>
47  * Note that this new structure does not include information on
48  * which packages are exported or present in the listed classpath entries. This
49  * information is no longer relevant.
50  * </p><p>
51  * See {@link IPluginDescriptor} for information on the relationship between plug-in
52  * descriptors and bundles.
53  * </p><p>
54  * This interface must only be used by plug-ins
55  * which explicitly require the org.eclipse.core.runtime.compatibility plug-in.
56  * </p>
57  */

58 public interface ILibrary {
59     /**
60      * Constant string (value "code") indicating the code library type.
61      * @deprecated As of Eclipse 3.0 library types are obsolete.
62      * There is no replacement.
63      */

64     public static final String JavaDoc CODE = "code"; //$NON-NLS-1$
65

66     /**
67      * Constant string (value "resource") indicating the resource library type.
68      * @deprecated As of Eclipse 3.0 library types are obsolete.
69      * There is no replacement.
70      */

71     public static final String JavaDoc RESOURCE = "resource"; //$NON-NLS-1$
72

73     /**
74      * Returns the content filters, or <code>null</code>.
75      * Each content filter identifies a specific class, or
76      * a group of classes, using a notation and matching rules
77      * equivalent to Java <code>import</code> declarations
78      * (e.g., "java.io.File", or "java.io.*"). Returns <code>null</code>
79      * if the library is not exported, or it is fully exported
80      * (no filtering).
81      *
82      * @return the content filters, or <code>null</code> if none
83      * @deprecated As of Eclipse 3.0 content filters are obsolete.
84      * There is no replacement.
85      */

86     public String JavaDoc[] getContentFilters();
87
88     /**
89      * Returns the path of this runtime library, relative to the
90      * installation location.
91      *
92      * @return the path of the library
93      * @see IPluginDescriptor#getInstallURL()
94      * @deprecated
95      * Given a manifest element corresponding to a classpath entry, the path
96      * for the entry can be accessed by getting the value of the manifest element.
97      * For example,
98      * <pre>
99      * element.getValue(); // the jar/dir containing the code
100      * </pre>
101      */

102     public IPath getPath();
103
104     /**
105      * Returns this library's type.
106      *
107      * @return the type of this library. The valid types are: <code>CODE</code> and <code>RESOURCE</code>.
108      * @see #CODE
109      * @see #RESOURCE
110      * @deprecated As of Eclipse 3.0 library types are obsolete.
111      * There is no replacement.
112      */

113     public String JavaDoc getType();
114
115     /**
116      * Returns whether the library is exported. The contents of an exported
117      * library may be visible to other plug-ins that declare a dependency
118      * on the plug-in containing this library, subject to content filtering.
119      * Libraries that are not exported are entirely private to the declaring
120      * plug-in.
121      *
122      * @return <code>true</code> if the library is exported, <code>false</code>
123      * if it is private
124      * @deprecated As of Eclipse 3.0 exporting an individual library is obsolete.
125      * There is no replacement.
126      */

127     public boolean isExported();
128
129     /**
130      * Returns whether this library is fully exported. A library is considered
131      * fully exported iff it is exported and has no content filters.
132      *
133      * @return <code>true</code> if the library is fully exported, and
134      * <code>false</code> if it is private or has filtered content
135      * @deprecated As of Eclipse 3.0 exporting an individual library is obsolete.
136      * There is no replacement.
137      */

138     public boolean isFullyExported();
139
140     /**
141      * Returns the array of package prefixes that this library declares. This
142      * is used in classloader enhancements and is an optional entry in the plugin.xml.
143      *
144      * @return the array of package prefixes or <code>null</code>
145      * @since 2.1
146      * @deprecated As of Eclipse 3.0 package prefix filtering is obsolete.
147      * There is no replacement.
148      */

149     public String JavaDoc[] getPackagePrefixes();
150 }
151
Popular Tags