org.apache.karaf.tooling.features
Class ManifestUtils

java.lang.Object
  extended by org.apache.karaf.tooling.features.ManifestUtils

public class ManifestUtils
extends java.lang.Object

A set of utility methods to ease working with Parser and Clause


Method Summary
static java.lang.String getBsn(java.util.jar.Manifest manifest)
           
static java.util.List<org.apache.felix.utils.manifest.Clause> getExports(java.util.jar.Manifest manifest)
          Get the list of exports from the manifest.
static java.lang.String getHeader(java.lang.String name, java.util.jar.Manifest manifest)
           
static java.util.List<org.apache.felix.utils.manifest.Clause> getImports(java.util.jar.Manifest manifest)
          Get the list of imports from the manifest.
static java.util.List<org.apache.felix.utils.manifest.Clause> getMandatoryImports(java.util.jar.Manifest manifest)
          Get the list of non-optional imports from the manifest.
static org.apache.felix.utils.version.VersionRange getVersionRange(org.apache.felix.utils.manifest.Clause clause)
           
static boolean isBundle(java.util.jar.Manifest manifest)
          Check if the manifest contains the mandatory Bundle-Symbolic-Name
static boolean isOptional(org.apache.felix.utils.manifest.Clause clause)
          Check if a given manifest clause represents an optional import
static boolean matches(org.apache.felix.utils.manifest.Clause requirement, org.apache.felix.utils.manifest.Clause export)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getImports

public static java.util.List<org.apache.felix.utils.manifest.Clause> getImports(java.util.jar.Manifest manifest)
Get the list of imports from the manifest. If no imports have been defined, this method returns an empty list.

Parameters:
manifest - the manifest
Returns:
the list of imports

getMandatoryImports

public static java.util.List<org.apache.felix.utils.manifest.Clause> getMandatoryImports(java.util.jar.Manifest manifest)
Get the list of non-optional imports from the manifest.

Parameters:
manifest - the manifest
Returns:
the list of non-optional imports

getExports

public static java.util.List<org.apache.felix.utils.manifest.Clause> getExports(java.util.jar.Manifest manifest)
Get the list of exports from the manifest. If no exports have been defined, this method returns an empty list.

Parameters:
manifest - the manifest
Returns:
the list of exports

isOptional

public static boolean isOptional(org.apache.felix.utils.manifest.Clause clause)
Check if a given manifest clause represents an optional import

Parameters:
clause - the manifest clause
Returns:
true for an optional import, false for mandatory imports

isBundle

public static boolean isBundle(java.util.jar.Manifest manifest)
Check if the manifest contains the mandatory Bundle-Symbolic-Name

Parameters:
manifest - the manifest
Returns:
true if the manifest specifies a Bundle-Symbolic-Name

matches

public static boolean matches(org.apache.felix.utils.manifest.Clause requirement,
                              org.apache.felix.utils.manifest.Clause export)

getHeader

public static java.lang.String getHeader(java.lang.String name,
                                         java.util.jar.Manifest manifest)

getBsn

public static java.lang.String getBsn(java.util.jar.Manifest manifest)

getVersionRange

public static org.apache.felix.utils.version.VersionRange getVersionRange(org.apache.felix.utils.manifest.Clause clause)


Copyright © 2007-2011 Apache Software Foundation. All Rights Reserved.