com.springsource.bundlor.internal.transformer
Class ManifestCreator

java.lang.Object
  extended by com.springsource.bundlor.internal.transformer.ManifestCreator

public class ManifestCreator
extends java.lang.Object

Handles creation of bundle manifests. Concurrent Semantics
Threadsafe.

Author:
Rob Harrop, Andy Wilkinson, Ben Hale

Field Summary
private  BundleManifestMerger merger
           
private  PartialManifestResolver partialManifestResolver
           
private  java.util.List<TemplateHeaderReader> templateHeaderReaders
           
 
Constructor Summary
ManifestCreator(java.util.List<TemplateHeaderReader> templateHeaderReaders)
           
 
Method Summary
 com.springsource.util.osgi.manifest.BundleManifest create(com.springsource.util.parser.manifest.ManifestContents artifactManifest, com.springsource.util.parser.manifest.ManifestContents manifestTemplate, ReadablePartialManifest partial)
          Creates the BundleManifest from the given partial, removing and possibly replacing existing directives from imports and exports that exist in the input manifest and the partial.
 com.springsource.util.osgi.manifest.BundleManifest merge(com.springsource.util.parser.manifest.ManifestContents artifactManifest, com.springsource.util.parser.manifest.ManifestContents manifestTemplate, ReadablePartialManifest partialManifest)
          Creates the BundleManifest from the given partial, merging (re-using) any existing import or export directives in the input manifest, such as resolution:=optional.
private  void removeTemplateOnlyHeaders(com.springsource.util.osgi.manifest.BundleManifest manifest)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

merger

private final BundleManifestMerger merger

partialManifestResolver

private final PartialManifestResolver partialManifestResolver

templateHeaderReaders

private final java.util.List<TemplateHeaderReader> templateHeaderReaders
Constructor Detail

ManifestCreator

public ManifestCreator(java.util.List<TemplateHeaderReader> templateHeaderReaders)
Method Detail

merge

public com.springsource.util.osgi.manifest.BundleManifest merge(com.springsource.util.parser.manifest.ManifestContents artifactManifest,
                                                                com.springsource.util.parser.manifest.ManifestContents manifestTemplate,
                                                                ReadablePartialManifest partialManifest)
Creates the BundleManifest from the given partial, merging (re-using) any existing import or export directives in the input manifest, such as resolution:=optional. All existing headers other than imports and exports are passed through unchanged, unless explicitly excluded in the template. Existing imports and exports are also re-used, enhancing and replacing explicit directives from the template. Imports and exports are passed through unchanged unless they are present in the partial (i.e. detected in the bundle being processed) or explicitly excluded (using Ignored-Existing-Headers: Import-Package, Export-Package) in the template.

Parameters:
partial - the partial manifest.
Returns:
the created BundleManifest.
See Also:
ManifestCreator#create(ReadablePartialManifest, List, Set)

create

public com.springsource.util.osgi.manifest.BundleManifest create(com.springsource.util.parser.manifest.ManifestContents artifactManifest,
                                                                 com.springsource.util.parser.manifest.ManifestContents manifestTemplate,
                                                                 ReadablePartialManifest partial)
Creates the BundleManifest from the given partial, removing and possibly replacing existing directives from imports and exports that exist in the input manifest and the partial. All existing headers other than imports and exports are passed through unchanged, unless explicitly excluded in the template. Existing imports and exports are also passed through unchanged unless they are present in the partial (i.e. detected in the bundle being processed), or explicitly excluded (using Ignored-Existing-Headers: Import-Package, Export-Package) in the template.

Parameters:
partial - the partial manifest.
Returns:
the created BundleManifest.
See Also:
#merge(ReadablePartialManifest, List, Set)

removeTemplateOnlyHeaders

private void removeTemplateOnlyHeaders(com.springsource.util.osgi.manifest.BundleManifest manifest)