Service Activator Toolkit
Version 1.1.0 (20081206)

org.eclipse.soda.sat.core.util
Class BundleManifestUtility

java.lang.Object
  extended by org.eclipse.soda.sat.core.util.BundleManifestUtility

public final class BundleManifestUtility
extends Object

The BundleManifestUtility class is a utility that simplifies working with the manifest file of a Bundle object.

Note: This is a singleton class, accessible only via the static method getInstance(). For example:

 BundleManifestUtility utility = BundleManifestUtility.getInstance();
 String[] packages = utility.getImportedPackages(bundle);
 


Method Summary
 String getBundleActivator(Bundle bundle)
          Answers the Bundle-Activator value from the bundle's MANIFEST.MF.
 String getBundleCategory(Bundle bundle)
          Answers the Bundle-Category value from the bundle's MANIFEST.MF.
 String getBundleClasspath(Bundle bundle)
          Answers the Bundle-Classpath value from the bundle's MANIFEST.MF.
 String getBundleContactAddress(Bundle bundle)
          Answers the Bundle-ContactAddress value from the bundle's MANIFEST.MF.
 String getBundleCopyright(Bundle bundle)
          Answers the Bundle-Copyright value from the bundle's MANIFEST.MF.
 String getBundleDescription(Bundle bundle)
          Answers the Bundle-Description value from the bundle's MANIFEST.MF.
 String getBundleDocUrl(Bundle bundle)
          Answers the Bundle-DocURL value from the bundle's MANIFEST.MF.
 String getBundleLocalization(Bundle bundle)
          Answers the Bundle-Localization value from the bundle's MANIFEST.MF.
 String getBundleManifestVersion(Bundle bundle)
          Answers the Bundle-ManifestVersion value from the bundle's MANIFEST.MF.
 String getBundleName(Bundle bundle)
          Answers the Bundle-Name value from the bundle's MANIFEST.MF.
 String getBundleNativeCode(Bundle bundle)
          Answers the Bundle-NativeCode value from the bundle's MANIFEST.MF.
 String[] getBundleRequiredExecutionEnvironments(Bundle bundle)
          Answers the Bundle-RequiredExecutionEnvironment values from the bundle's MANIFEST.MF.
 String getBundleSymbolicName(Bundle bundle)
          Answers the Bundle-SymbolicName value from the bundle's MANIFEST.MF.
 String getBundleSymbolicName(Bundle bundle, boolean includeParameters)
          Answers the Bundle-SymbolicName value from the bundle's MANIFEST.MF.
 String getBundleUpdateLocation(Bundle bundle)
          Answers the Bundle-UpdateLocation value from the bundle's MANIFEST.MF.
 String getBundleVendor(Bundle bundle)
          Answers the Bundle-Vender value from the bundle's MANIFEST.MF.
 String getBundleVersion(Bundle bundle)
          Answers the Bundle-Version value from the bundle's MANIFEST.MF.
 String[] getDynamicImportPackages(Bundle bundle)
          Answers the DynamicImport-Package values from the bundle's MANIFEST.MF.
 String[] getExportPackages(Bundle bundle)
          Answers the Export-Service values from the bundle's MANIFEST.MF.
 String[] getExportPackages(Bundle bundle, boolean includeParameters)
          Answers the Export-Service values from the bundle's MANIFEST.MF.
 String[] getExportServices(Bundle bundle)
          Deprecated. OSGi R4 has deprecated the Export-Service header.
 String getFragmentHost(Bundle bundle)
          Answers the Fragment-Host value from the bundle's MANIFEST.MF.
 String getFragmentHost(Bundle bundle, boolean includeParameters)
          Answers the Fragment-Host value from the bundle's MANIFEST.MF.
 String getHeader(Bundle bundle, String key)
          Retrieves the localized value, represented by the key, from the bundle's MANIFEST.MF file.
 String getHeader(Bundle bundle, String key, String locale)
          Retrieves the localized value, represented by the key, from the bundle's MANIFEST.MF file, using the specified locale.
 String[] getImportPackages(Bundle bundle)
          Answers the Import-Package values from the bundle's MANIFEST.MF.
 String[] getImportPackages(Bundle bundle, boolean includeParameters)
          Answers the Import-Package values from the bundle's MANIFEST.MF.
 String[] getImportServices(Bundle bundle)
          Deprecated. OSGi R4 has deprecated the Import-Service header.
static BundleManifestUtility getInstance()
          Public getter for the BundleManifestUtility singleton instance.
 String[] getRequireBundles(Bundle bundle)
          Answers the Require-Bundle values from the bundle's MANIFEST.MF.
 String[] getRequireBundles(Bundle bundle, boolean includeParameters)
          Answers the Require-Bundle values from the bundle's MANIFEST.MF.
 String[] getServiceComponents(Bundle bundle)
          Answers the Service-Component values from the bundle's MANIFEST.MF.
 String getUnlocalizedHeader(Bundle bundle, String key)
          Retrieves the unlocalized value, represented by the key, from the bundle's MANIFEST.MF file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static BundleManifestUtility getInstance()
Public getter for the BundleManifestUtility singleton instance.

Returns:
The BundleManifestUtility singleton instance.

getBundleActivator

public String getBundleActivator(Bundle bundle)
Answers the Bundle-Activator value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleCategory

public String getBundleCategory(Bundle bundle)
Answers the Bundle-Category value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleClasspath

public String getBundleClasspath(Bundle bundle)
Answers the Bundle-Classpath value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleContactAddress

public String getBundleContactAddress(Bundle bundle)
Answers the Bundle-ContactAddress value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleCopyright

public String getBundleCopyright(Bundle bundle)
Answers the Bundle-Copyright value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleDescription

public String getBundleDescription(Bundle bundle)
Answers the Bundle-Description value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleDocUrl

public String getBundleDocUrl(Bundle bundle)
Answers the Bundle-DocURL value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleLocalization

public String getBundleLocalization(Bundle bundle)
Answers the Bundle-Localization value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleManifestVersion

public String getBundleManifestVersion(Bundle bundle)
Answers the Bundle-ManifestVersion value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleName

public String getBundleName(Bundle bundle)
Answers the Bundle-Name value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleNativeCode

public String getBundleNativeCode(Bundle bundle)
Answers the Bundle-NativeCode value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleRequiredExecutionEnvironments

public String[] getBundleRequiredExecutionEnvironments(Bundle bundle)
Answers the Bundle-RequiredExecutionEnvironment values from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String array

getBundleSymbolicName

public String getBundleSymbolicName(Bundle bundle)
Answers the Bundle-SymbolicName value from the bundle's MANIFEST.MF. This method is new for OSGi R4 support.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleSymbolicName

public String getBundleSymbolicName(Bundle bundle,
                                    boolean includeParameters)
Answers the Bundle-SymbolicName value from the bundle's MANIFEST.MF. This method is new for OSGi R4 support.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
includeParameters - Whether to include parameters or not.
Returns:
String

getBundleUpdateLocation

public String getBundleUpdateLocation(Bundle bundle)
Answers the Bundle-UpdateLocation value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleVendor

public String getBundleVendor(Bundle bundle)
Answers the Bundle-Vender value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getBundleVersion

public String getBundleVersion(Bundle bundle)
Answers the Bundle-Version value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getDynamicImportPackages

public String[] getDynamicImportPackages(Bundle bundle)
Answers the DynamicImport-Package values from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String array

getExportPackages

public String[] getExportPackages(Bundle bundle)
Answers the Export-Service values from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String array

getExportPackages

public String[] getExportPackages(Bundle bundle,
                                  boolean includeParameters)
Answers the Export-Service values from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
includeParameters - Whether to include parameters or not.
Returns:
String array

getExportServices

public String[] getExportServices(Bundle bundle)
Deprecated. OSGi R4 has deprecated the Export-Service header.

Answers the Export-Service values from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String array

getFragmentHost

public String getFragmentHost(Bundle bundle)
Answers the Fragment-Host value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String

getFragmentHost

public String getFragmentHost(Bundle bundle,
                              boolean includeParameters)
Answers the Fragment-Host value from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
includeParameters - Whether to include parameters or not.
Returns:
String

getHeader

public String getHeader(Bundle bundle,
                        String key)
Retrieves the localized value, represented by the key, from the bundle's MANIFEST.MF file.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
key - The key to the MANIFEST.MF entry.
Returns:
String

getHeader

public String getHeader(Bundle bundle,
                        String key,
                        String locale)
Retrieves the localized value, represented by the key, from the bundle's MANIFEST.MF file, using the specified locale.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
key - The key to the MANIFEST.MF entry.
locale - The locale to use.
Returns:
String

getImportPackages

public String[] getImportPackages(Bundle bundle)
Answers the Import-Package values from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String array

getImportPackages

public String[] getImportPackages(Bundle bundle,
                                  boolean includeParameters)
Answers the Import-Package values from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
includeParameters - Whether to include parameters or not.
Returns:
String array

getImportServices

public String[] getImportServices(Bundle bundle)
Deprecated. OSGi R4 has deprecated the Import-Service header.

Answers the Import-Service values from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String array

getRequireBundles

public String[] getRequireBundles(Bundle bundle)
Answers the Require-Bundle values from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String array

getRequireBundles

public String[] getRequireBundles(Bundle bundle,
                                  boolean includeParameters)
Answers the Require-Bundle values from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
includeParameters - Whether to include parameters or not.
Returns:
String array

getServiceComponents

public String[] getServiceComponents(Bundle bundle)
Answers the Service-Component values from the bundle's MANIFEST.MF.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
Returns:
String array

getUnlocalizedHeader

public String getUnlocalizedHeader(Bundle bundle,
                                   String key)
Retrieves the unlocalized value, represented by the key, from the bundle's MANIFEST.MF file.

Parameters:
bundle - The bundle whose MANIFEST.MF will be read.
key - The key to the MANIFEST.MF entry.
Returns:
String

Service Activator Toolkit
Version 1.1.0 (20081206)