Module de.carne
Package de.carne.util

Class ManifestInfos


  • public class ManifestInfos
    extends java.lang.Object
    Utility class used to access a module's manifest.
    • Constructor Summary

      Constructors 
      Constructor Description
      ManifestInfos​(java.lang.String moduleId)
      Constructs a new ManifestInfos instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String build()
      Gets the module build identifier stored in the manifest.
      java.lang.String getMainAttribute​(java.lang.String attributeName, java.lang.String defaultValue)
      Gets a manifest's main attribute.
      static java.util.SortedMap<java.lang.String,​ManifestInfos> getRuntimeInfos()
      Collects all ManifestInfos available in the current runtime environment.
      java.lang.String id()
      Gets the module id stored in the manifest.
      java.lang.String name()
      Gets the module name stored in the manifest.
      java.lang.String toString()  
      java.lang.String version()
      Gets the module version stored in the manifest.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • ATTRIBUTE_MODULE_ID

        public static final java.lang.String ATTRIBUTE_MODULE_ID
        Module id attribute.
        See Also:
        Constant Field Values
      • ATTRIBUTE_MODULE_NAME

        public static final java.lang.String ATTRIBUTE_MODULE_NAME
        Module name attribute.
        See Also:
        Constant Field Values
      • ATTRIBUTE_MODULE_VERSION

        public static final java.lang.String ATTRIBUTE_MODULE_VERSION
        Module version attribute.
        See Also:
        Constant Field Values
      • ATTRIBUTE_BUILD_TIMESTAMP

        public static final java.lang.String ATTRIBUTE_BUILD_TIMESTAMP
        Build timestamp attribute.
        See Also:
        Constant Field Values
      • NA

        public static final java.lang.String NA
        The default value used in case an attribute is not defined in the manifest.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ManifestInfos

        public ManifestInfos​(java.lang.String moduleId)
        Constructs a new ManifestInfos instance.
        Parameters:
        moduleId - the id of the module to get the manifest for.
    • Method Detail

      • getRuntimeInfos

        public static java.util.SortedMap<java.lang.String,​ManifestInfos> getRuntimeInfos()
        Collects all ManifestInfos available in the current runtime environment.
        Returns:
        all ManifestInfos available in the current runtime environment.
      • getMainAttribute

        public java.lang.String getMainAttribute​(java.lang.String attributeName,
                                                 java.lang.String defaultValue)
        Gets a manifest's main attribute.
        Parameters:
        attributeName - the attribute name to get.
        defaultValue - the default value to return in case the attribute undefined.
        Returns:
        the found attribute value or the submitted default value in case the attribute is undefined.
      • id

        public java.lang.String id()
        Gets the module id stored in the manifest.
        Returns:
        the module id stored in the manifest.
      • name

        public java.lang.String name()
        Gets the module name stored in the manifest.

        NA is returned if no manifest was found or if the manifest contains no information.

        Returns:
        the module name stored in the manifest.
      • version

        public java.lang.String version()
        Gets the module version stored in the manifest.

        NA is returned if no manifest was found or if the manifest contains no information.

        Returns:
        the module version stored in the manifest.
      • build

        public java.lang.String build()
        Gets the module build identifier stored in the manifest.

        NA is returned if no manifest was found or if the manifest contains no information.

        Returns:
        the module build identifier stored in the manifest.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object