- java.lang.Object
-
- de.carne.util.ManifestInfos
-
public class ManifestInfos extends java.lang.ObjectUtility class used to access a module's manifest.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringATTRIBUTE_BUILD_TIMESTAMPBuild timestamp attribute.static java.lang.StringATTRIBUTE_MODULE_IDModule id attribute.static java.lang.StringATTRIBUTE_MODULE_NAMEModule name attribute.static java.lang.StringATTRIBUTE_MODULE_VERSIONModule version attribute.static java.lang.StringNAThe default value used in case an attribute is not defined in the 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.Stringbuild()Gets the module build identifier stored in the manifest.java.lang.StringgetMainAttribute(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.Stringid()Gets the module id stored in the manifest.java.lang.Stringname()Gets the module name stored in the manifest.java.lang.StringtoString()java.lang.Stringversion()Gets the module version stored in the manifest.
-
-
-
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:
toStringin classjava.lang.Object
-
-