Class OsgiHeader


  • public abstract class OsgiHeader
    extends java.lang.Object
    This interface acts as a namespace for the supported OSGi bundle headers.
    Author:
    Simon Thoresen Hult
    • Constructor Summary

      Constructors 
      Constructor Description
      OsgiHeader()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> asList​(org.osgi.framework.Bundle bundle, java.lang.String headerName)
      This method reads the named header from the manifest of the given bundle, and parses it as a comma-separated list of values.
      static boolean isSet​(org.osgi.framework.Bundle bundle, java.lang.String headerName)
      Returns true if the named header is present in the manifest of the given bundle.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OsgiHeader

        public OsgiHeader()
    • Method Detail

      • isSet

        public static boolean isSet​(org.osgi.framework.Bundle bundle,
                                    java.lang.String headerName)
        Returns true if the named header is present in the manifest of the given bundle.
        Parameters:
        bundle - The bundle whose manifest to check.
        headerName - The name of the header to check for.
        Returns:
        True if header is present.
      • asList

        public static java.util.List<java.lang.String> asList​(org.osgi.framework.Bundle bundle,
                                                              java.lang.String headerName)
        This method reads the named header from the manifest of the given bundle, and parses it as a comma-separated list of values. If the header is not set, this method returns an empty list.
        Parameters:
        bundle - The bundle whose manifest to parse the header from.
        headerName - The name of the header to parse.
        Returns:
        A list of parsed header values, may be empty.