com.springsource.util.osgi.manifest
Interface BundleManifest

All Known Implementing Classes:
StandardBundleManifest

public interface BundleManifest

Represents an OSGi bundle's manifest.

Concurrent Semantics
Implementations of this interface need not be thread safe.

Since:
1.0
Author:
Glyn Normington, Andy Wilkinson

Field Summary
static java.lang.String IMPORT_BUNDLE
          The Import-Bundle bundle manifest header.
static java.lang.String IMPORT_LIBRARY
          The Import-Library bundle manifest header.
static java.lang.String MODULE_SCOPE
          The Module-Scope bundle manifest header.
static java.lang.String MODULE_TYPE
          The Module-Type bundle manifest header.
 
Method Summary
 BundleActivationPolicy getBundleActivationPolicy()
          Returns the Bundle-ActivationPolicy header, never null.
 java.util.List<java.lang.String> getBundleClasspath()
          Returns a List containing an item for each entry in the comma-separated Bundle-Classpath header.
 java.lang.String getBundleDescription()
          Returns the value of the Bundle-Description header, or null if no description is specified.
 int getBundleManifestVersion()
          Returns the Bundle-ManifestVersion header, or 1 if no manifest version is specified.
 java.lang.String getBundleName()
          Returns the Bundle-Name header, or null if no name is specified.
 BundleSymbolicName getBundleSymbolicName()
          Returns the Bundle-SymbolicName header, never null.
 java.net.URL getBundleUpdateLocation()
          Returns the value of the Bundle-UpdateLocation header, or null if no update location is specified.
 org.osgi.framework.Version getBundleVersion()
          Returns the value of the Bundle-Version header, or null if no version is specified.
 DynamicImportPackage getDynamicImportPackage()
          Returns the DynamicImport-Package header, never null.
 ExportPackage getExportPackage()
          Returns the Export-Package header, never null.
 FragmentHost getFragmentHost()
          Returns the Fragment-Host header, never null.
 java.lang.String getHeader(java.lang.String name)
          Returns the value of the header identified by the supplied name.
 ImportBundle getImportBundle()
          Returns the Import-Bundle header, never null.
 ImportLibrary getImportLibrary()
          Returns the Import-Library header, never null.
 ImportPackage getImportPackage()
          Returns the Import-Package header, never null.
 java.lang.String getModuleScope()
          Returns the value of the Module-Scope header, or null if no module scope is specified.
 java.lang.String getModuleType()
          Returns the value of the Module-Type header, or null if no module type is specified.
 RequireBundle getRequireBundle()
          Returns the Require-Bundle header, never null.
 void setBundleDescription(java.lang.String bundleDescription)
          Sets the value of the Bundle-Description header.
 void setBundleManifestVersion(int bundleManifestVersion)
          Sets the value of the Bundle-ManifestVersion header.
 void setBundleName(java.lang.String bundleName)
          Sets the value of the Bundle-Name header.
 void setBundleUpdateLocation(java.net.URL bundleUpdateLocation)
          Sets the value of the Bundle-UpdateLocation header.
 void setBundleVersion(org.osgi.framework.Version bundleVersion)
          Set the value of the Bundle-Version header.
 void setHeader(java.lang.String name, java.lang.String value)
          Sets the header with the supplied name to have the supplied value.
 void setModuleScope(java.lang.String moduleScope)
          Sets the value of the Module-Scope header.
 void setModuleType(java.lang.String moduleType)
          Sets the value of the Module-Type header.
 java.util.Dictionary<java.lang.String,java.lang.String> toDictionary()
          Returns a snapshot of this manifest as a Dictionary
 void write(java.io.Writer writer)
          Writes the contents of this manifest to the supplied writer
 

Field Detail

IMPORT_BUNDLE

static final java.lang.String IMPORT_BUNDLE
The Import-Bundle bundle manifest header.

See Also:
Constant Field Values

IMPORT_LIBRARY

static final java.lang.String IMPORT_LIBRARY
The Import-Library bundle manifest header.

See Also:
Constant Field Values

MODULE_SCOPE

static final java.lang.String MODULE_SCOPE
The Module-Scope bundle manifest header.

See Also:
Constant Field Values

MODULE_TYPE

static final java.lang.String MODULE_TYPE
The Module-Type bundle manifest header.

See Also:
Constant Field Values
Method Detail

getBundleActivationPolicy

BundleActivationPolicy getBundleActivationPolicy()
Returns the Bundle-ActivationPolicy header, never null.

Returns:
the Bundle-ActivationPolicy header.

getBundleClasspath

java.util.List<java.lang.String> getBundleClasspath()
Returns a List containing an item for each entry in the comma-separated Bundle-Classpath header. Returns an empty list if the manifest does not contain a Bundle-Classpath header.

Returns:
a List of the entries in the Bundle-Classpath header.

getBundleDescription

java.lang.String getBundleDescription()
Returns the value of the Bundle-Description header, or null if no description is specified.

Returns:
the value of the Bundle-Description header.

setBundleDescription

void setBundleDescription(java.lang.String bundleDescription)
Sets the value of the Bundle-Description header.

Parameters:
bundleDescription - The bundle's description

getBundleManifestVersion

int getBundleManifestVersion()
Returns the Bundle-ManifestVersion header, or 1 if no manifest version is specified.

Returns:
the value of the Bundle-ManifestVersion header.

setBundleManifestVersion

void setBundleManifestVersion(int bundleManifestVersion)
Sets the value of the Bundle-ManifestVersion header.

Parameters:
bundleManifestVersion - The bundle's bundle manifest version

getBundleName

java.lang.String getBundleName()
Returns the Bundle-Name header, or null if no name is specified.

Returns:
the value of the Bundle-Name header.

setBundleName

void setBundleName(java.lang.String bundleName)
Sets the value of the Bundle-Name header.

Parameters:
bundleName - The bundle's name

getBundleSymbolicName

BundleSymbolicName getBundleSymbolicName()
Returns the Bundle-SymbolicName header, never null.

Returns:
the Bundle-SymbolicName header.

getBundleUpdateLocation

java.net.URL getBundleUpdateLocation()
Returns the value of the Bundle-UpdateLocation header, or null if no update location is specified.

Returns:
the value of the Bundle-UpdateLocation header.

setBundleUpdateLocation

void setBundleUpdateLocation(java.net.URL bundleUpdateLocation)
Sets the value of the Bundle-UpdateLocation header.

Parameters:
bundleUpdateLocation - The bundle's update location

getDynamicImportPackage

DynamicImportPackage getDynamicImportPackage()
Returns the DynamicImport-Package header, never null.

Returns:
the DynamicImport-Package header.

getExportPackage

ExportPackage getExportPackage()
Returns the Export-Package header, never null.

Returns:
the Export-Package header.

getFragmentHost

FragmentHost getFragmentHost()
Returns the Fragment-Host header, never null.

Returns:
the Fragment-Host header.

getImportBundle

ImportBundle getImportBundle()
Returns the Import-Bundle header, never null.

Returns:
the Import-Bundle header.

getImportLibrary

ImportLibrary getImportLibrary()
Returns the Import-Library header, never null.

Returns:
the Import-Library header.

getImportPackage

ImportPackage getImportPackage()
Returns the Import-Package header, never null.

Returns:
the Import-Package header.

getModuleScope

java.lang.String getModuleScope()
Returns the value of the Module-Scope header, or null if no module scope is specified.

Returns:
the value of the Module-Scope header.

setModuleScope

void setModuleScope(java.lang.String moduleScope)
Sets the value of the Module-Scope header.

Parameters:
moduleScope - The bundle's module scope

getModuleType

java.lang.String getModuleType()
Returns the value of the Module-Type header, or null if no module type is specified.

Returns:
the value of the Module-Type header.

setModuleType

void setModuleType(java.lang.String moduleType)
Sets the value of the Module-Type header.

Parameters:
moduleType - The bundle's module type

getRequireBundle

RequireBundle getRequireBundle()
Returns the Require-Bundle header, never null.

Returns:
the Require-Bundle header.

getBundleVersion

org.osgi.framework.Version getBundleVersion()
Returns the value of the Bundle-Version header, or null if no version is specified.

Returns:
the bundle's version

setBundleVersion

void setBundleVersion(org.osgi.framework.Version bundleVersion)
Set the value of the Bundle-Version header.

Parameters:
bundleVersion - bundle's version

getHeader

java.lang.String getHeader(java.lang.String name)
Returns the value of the header identified by the supplied name.

Parameters:
name - the name of the header
Returns:
the value of the header

setHeader

void setHeader(java.lang.String name,
               java.lang.String value)
Sets the header with the supplied name to have the supplied value.

Parameters:
name - The name of the header
value - The value of the header

toDictionary

java.util.Dictionary<java.lang.String,java.lang.String> toDictionary()
Returns a snapshot of this manifest as a Dictionary

Returns:
This manifest in Dictionary form.

write

void write(java.io.Writer writer)
           throws java.io.IOException
Writes the contents of this manifest to the supplied writer

Parameters:
writer - the writer to which the manifest is written
Throws:
java.io.IOException - if a problem occurs when writing out the manifest