Interface IBundleProjectService
-
public interface IBundleProjectServiceService used to create and configure bundle project descriptions.An instance of this service can be obtained from a
BundleContextas followsBundleContext context = ... ServiceReference
ref = context.getServiceReference(IBundleContextService.class); IBundleContextService service = context.getService(ref); ... context.ungetService(ref); - Since:
- 3.6
- Restriction:
- This interface is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be extended by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IBundleProjectDescriptiongetDescription(IProject project)Returns a bundle description for the given project.IBundleClasspathEntrynewBundleClasspathEntry(IPath sourceFolder, IPath binaryFolder, IPath library)Creates and returns a new bundle classpath entry defining the relationship between a source, binaries, and library on the Bundle-Classpath header.IHostDescriptionnewHost(String name, VersionRange range)Creates and returns a new host description.IPackageExportDescriptionnewPackageExport(String name, Version version, boolean api, String[] friends)Constructs a new package export description.IPackageImportDescriptionnewPackageImport(String name, VersionRange range, boolean optional)Creates and returns a new package import description.IRequiredBundleDescriptionnewRequiredBundle(String name, VersionRange range, boolean optional, boolean export)Creates and returns a new required bundle description.voidsetBundleRoot(IProject project, IPath bundleRoot)Sets the location within the project where the root of the bundle and its associated artifacts will reside, ornullto indicate the default bundle root location should be used (project folder).
-
-
-
Method Detail
-
getDescription
IBundleProjectDescription getDescription(IProject project) throws CoreException
Returns a bundle description for the given project. If the project does not exist, the description can be used to create a new bundle project. If the project does exist, the description can be used to modify a project.- Parameters:
project- project- Returns:
- bundle description for the associated project
- Throws:
CoreException- if unable to create a description on an existing project
-
newHost
IHostDescription newHost(String name, VersionRange range)
Creates and returns a new host description.- Parameters:
name- symbolic name of the hostrange- version constraint ornull- Returns:
- host description
-
newPackageImport
IPackageImportDescription newPackageImport(String name, VersionRange range, boolean optional)
Creates and returns a new package import description.- Parameters:
name- fully qualified name of imported packagerange- version constraint ornulloptional- whether the import is optional- Returns:
- package import description
-
newPackageExport
IPackageExportDescription newPackageExport(String name, Version version, boolean api, String[] friends)
Constructs a new package export description.- Parameters:
name- fully qualified package nameversion- version ornullapi- whether the package is considered APIfriends- symbolic names of bundles that are friends, ornull; when friends are specified the package will not be API- Returns:
- package export description
-
newRequiredBundle
IRequiredBundleDescription newRequiredBundle(String name, VersionRange range, boolean optional, boolean export)
Creates and returns a new required bundle description.- Parameters:
name- symbolic name of required bundlerange- version constraint ornulloptional- whether the required bundle is optionalexport- whether the required bundle is re-exported- Returns:
- required bundle description
-
newBundleClasspathEntry
IBundleClasspathEntry newBundleClasspathEntry(IPath sourceFolder, IPath binaryFolder, IPath library)
Creates and returns a new bundle classpath entry defining the relationship between a source, binaries, and library on the Bundle-Classpath header.When a source folder is specified, the binary folder defines its output folder, or may be
nullto indicate that the project's default output folder is used by the source folder. When only a binary folder is specified, there is no source associated with the folder. When no source or binary are specified, it indicates the library is included in the project as an archive.- Parameters:
sourceFolder- source folder ornullbinaryFolder- binary folder ornulllibrary- associated entry on the Bundle-Classpath header ornullto indicate default entry "."- Returns:
- a new bundle classpath entry
-
setBundleRoot
void setBundleRoot(IProject project, IPath bundleRoot) throws CoreException
Sets the location within the project where the root of the bundle and its associated artifacts will reside, ornullto indicate the default bundle root location should be used (project folder).The bundle root is the folder containing the
META-INF/folder. When the bundle root location is modified, existing bundle artifacts at the old root are not moved or modified. When creating a new bundle projectIBundleProjectDescription.setBundleRoot(IPath)can be used to specify an initial bundle root location. To modify the bundle root location of an existing project, this method must be used.- Parameters:
project- project that must exist and be openbundleRoot- project relative path to bundle root artifacts in the project ornull- Throws:
CoreException- if setting the root fails
-
-