com.springsource.bundlor.support.contributors
Class ExcludedImportAndExportPartialManifestModifier

java.lang.Object
  extended by com.springsource.bundlor.support.contributors.ExcludedImportAndExportPartialManifestModifier
All Implemented Interfaces:
ManifestReader, PartialManifestModifier, TemplateHeaderReader

public final class ExcludedImportAndExportPartialManifestModifier
extends java.lang.Object
implements ManifestReader, PartialManifestModifier, TemplateHeaderReader

An implementation of PartialManifestModifier that removes excluded imports and exports from the partial manifest

Concurrent Semantics
Threadsafe

Author:
Ben Hale

Field Summary
private static java.lang.String ATTR_EXCLUDED_EXPORTS
           
private static java.lang.String ATTR_EXCLUDED_IMPORTS
           
private  java.util.List<java.lang.String> excludedExports
           
private  java.lang.Object excludedExportsMonitor
           
private  java.util.List<java.lang.String> excludedImports
           
private  java.lang.Object excludedImportsMonitor
           
 
Constructor Summary
ExcludedImportAndExportPartialManifestModifier()
           
 
Method Summary
 java.util.List<java.lang.String> getTemplateOnlyHeaderNames()
          Gets the list of header names required by this reader.
private  boolean isExcluded(java.lang.String exportedPackage, java.util.List<java.lang.String> exclusions)
           
 void modify(ReadablePartialManifest partialManifest)
          Modify the partial manifest before it is used to create the bundle manifest
private  java.util.List<com.springsource.util.osgi.manifest.parse.HeaderDeclaration> parseTemplate(java.lang.String template)
           
 void readJarManifest(com.springsource.util.parser.manifest.ManifestContents manifest)
          Read the source JAR's manifest before it is used to create the bundle manifest
 void readManifestTemplate(com.springsource.util.parser.manifest.ManifestContents manifestTemplate)
          Read the manifest template before it is used to create the bundle manifest
private  void removeExcludedPackages(java.util.Set<java.lang.String> packageNames, java.util.List<java.lang.String> exclusions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_EXCLUDED_EXPORTS

private static final java.lang.String ATTR_EXCLUDED_EXPORTS
See Also:
Constant Field Values

ATTR_EXCLUDED_IMPORTS

private static final java.lang.String ATTR_EXCLUDED_IMPORTS
See Also:
Constant Field Values

excludedImports

private final java.util.List<java.lang.String> excludedImports

excludedImportsMonitor

private final java.lang.Object excludedImportsMonitor

excludedExports

private final java.util.List<java.lang.String> excludedExports

excludedExportsMonitor

private final java.lang.Object excludedExportsMonitor
Constructor Detail

ExcludedImportAndExportPartialManifestModifier

public ExcludedImportAndExportPartialManifestModifier()
Method Detail

readJarManifest

public void readJarManifest(com.springsource.util.parser.manifest.ManifestContents manifest)
Description copied from interface: ManifestReader
Read the source JAR's manifest before it is used to create the bundle manifest

Specified by:
readJarManifest in interface ManifestReader
Parameters:
manifest - the JAR manifest

readManifestTemplate

public void readManifestTemplate(com.springsource.util.parser.manifest.ManifestContents manifestTemplate)
Description copied from interface: ManifestReader
Read the manifest template before it is used to create the bundle manifest

Specified by:
readManifestTemplate in interface ManifestReader
Parameters:
manifestTemplate - the manifest template

parseTemplate

private java.util.List<com.springsource.util.osgi.manifest.parse.HeaderDeclaration> parseTemplate(java.lang.String template)

modify

public void modify(ReadablePartialManifest partialManifest)
Description copied from interface: PartialManifestModifier
Modify the partial manifest before it is used to create the bundle manifest

Specified by:
modify in interface PartialManifestModifier
Parameters:
partialManifest - the partial manifest to modify

removeExcludedPackages

private void removeExcludedPackages(java.util.Set<java.lang.String> packageNames,
                                    java.util.List<java.lang.String> exclusions)

isExcluded

private boolean isExcluded(java.lang.String exportedPackage,
                           java.util.List<java.lang.String> exclusions)

getTemplateOnlyHeaderNames

public java.util.List<java.lang.String> getTemplateOnlyHeaderNames()
Description copied from interface: TemplateHeaderReader
Gets the list of header names required by this reader.

Specified by:
getTemplateOnlyHeaderNames in interface TemplateHeaderReader
Returns:
The list of header names.