KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > osgi > service > pluginconversion > PluginConverter


1 /*******************************************************************************
2  * Copyright (c) 2003, 2005 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.osgi.service.pluginconversion;
12
13 import java.io.File JavaDoc;
14 import java.util.Dictionary JavaDoc;
15
16 /**
17  * A plug-in convertor is able to convert plug-in manifest files (<tt>plugin.xml</tt>) and
18  * fragment manifest files (<tt>fragment.xml</tt>) to bundle manifest files (<tt>MANIFEST.MF</tt>).
19  * <p>
20  * This interface is not intended to be implemented by clients.
21  * </p>
22  *
23  * @since 3.0
24  */

25 public interface PluginConverter {
26     /**
27      * Converts a plug-in/fragment manifest at the given source base location (a directory) and
28      * generates a corresponding bundle manifest at the given default target locaton (a file).
29      *
30      * @param pluginBaseLocation the base location for the plug-in/fragment manifest to be converted
31      * (a directory, e.g. the plug-in install location)
32      * @param bundleManifestLocation the location for the bundle manifest to be generated
33      * (including the file name).
34      * @param compatibilityManifest a boolean indicating if the manifest should contain headers to run
35      * in backward compatibility
36      * @param target a string indicating the version of the runtime for which the manifest generated is targeted
37      * @param analyseJars a boolean indicating if the code jars of the given plugin must be analysed. When set to false the Export-Package header will not be set in the bundle manifest.
38      * @param devProperties a dictionary of development time classpath properties. The dictionary contains a mapping from plugin id to development
39      * time classpath. A value of <code>null</code> indicates that the default development time classpath properties will be used.
40      * @return the generated manifest file location, if a bundle manifest was successfully
41      * generated (or already existed), <code>null</code> otherwise.
42      * @throws PluginConversionException if an error occurs while converting the manifest
43      */

44     public File JavaDoc convertManifest(File JavaDoc pluginBaseLocation, File JavaDoc bundleManifestLocation, boolean compatibilityManifest, String JavaDoc target, boolean analyseJars, Dictionary JavaDoc devProperties) throws PluginConversionException;
45
46     /**
47      * Converts a plug-in/fragment manifest at the given source base location (a directory) and
48      * generates a corresponding bundle manifest returned as a dictionary.
49      *
50      * @param pluginBaseLocation the base location for the plug-in/fragment manifest to be converted
51      * (a directory, e.g. the plug-in install location)
52      * @param compatibility a boolean indicating if the manifest should contain headers to run
53      * in backward compatibility
54      * @param target a string indicating the version of the runtime for which the manifest generated is targeted
55      * @param analyseJars a boolean indicating if the code jars of the given plugin must be analysed. When set to false the Export-Package header will not be set in the bundle manifest.
56      * @param devProperties a dictionary of development time classpath properties. The dictionary contains a mapping from plugin id to development
57      * time classpath. A value of <code>null</code> indicates that the default development time classpath properties will be used.
58      * @return the generated manifest as a dictionary, if a bundle manifest was successfully
59      * generated, <code>null</code> otherwise
60      * @throws PluginConversionException if an error occurs while converting the manifest
61      */

62     public Dictionary JavaDoc convertManifest(File JavaDoc pluginBaseLocation, boolean compatibility, String JavaDoc target, boolean analyseJars, Dictionary JavaDoc devProperties) throws PluginConversionException;
63
64     /**
65      * Construct a bundle manifest file from the given dictionary and write it out to the
66      * specified location in the file system.
67      * <p>
68      * If the <code>compatibilityManifest</code> parameter is <code>true</code> then
69      * the generated manifest will include the necessary headers to all the manifest to be
70      * run in backwards compatibility mode.
71      * </p>
72      *
73      * @param generationLocation the location for the bundle manifest to be written
74      * @param manifestToWrite the dictionary to write into generationLocation file
75      * @param compatibilityManifest a boolean indicating if the file should contain headers to allow
76      * running in backward compatibility mode
77      * @throws PluginConversionException if an error occurs while writing the given manifest
78      */

79     public void writeManifest(File JavaDoc generationLocation, Dictionary JavaDoc manifestToWrite, boolean compatibilityManifest) throws PluginConversionException;
80 }
81
Popular Tags