Package biz.aQute.bnd.reporter.helpers
Class ManifestHelper
- java.lang.Object
-
- biz.aQute.bnd.reporter.helpers.ManifestHelper
-
public class ManifestHelper extends java.lang.Object
An helper to extract manifest headers taking into account the localization.
-
-
Field Summary
Fields Modifier and Type Field Description private LocaleHelper
_loHelper
private java.util.jar.Manifest
_manifest
private static java.lang.String
DEFAULT_LOCALIZATION_BASE
-
Constructor Summary
Constructors Modifier Constructor Description private
ManifestHelper(Jar jar, java.util.jar.Manifest manifest, java.util.Locale locale)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ManifestHelper
createIfPresent(Jar jar, java.util.Locale locale)
Create aManifestHelper
if the specified jar contains a manifest, otherwise returnnull
.Parameters
getHeader(java.lang.String headerName, boolean allowDuplicateAttributes)
Gets the header value for the locale of this helper instance.java.lang.String
getHeaderAsString(java.lang.String headerName)
Gets the header value for the locale of this helper instance.
-
-
-
Field Detail
-
DEFAULT_LOCALIZATION_BASE
private static final java.lang.String DEFAULT_LOCALIZATION_BASE
- See Also:
- Constant Field Values
-
_loHelper
private LocaleHelper _loHelper
-
_manifest
private final java.util.jar.Manifest _manifest
-
-
Constructor Detail
-
ManifestHelper
private ManifestHelper(Jar jar, java.util.jar.Manifest manifest, java.util.Locale locale)
-
-
Method Detail
-
createIfPresent
public static ManifestHelper createIfPresent(Jar jar, java.util.Locale locale)
Create aManifestHelper
if the specified jar contains a manifest, otherwise returnnull
.- Parameters:
jar
- the jar, must not benull
locale
- the locale, must not benull
- Returns:
- the helper or
null
if the jar does not contain a manifest
-
getHeader
public Parameters getHeader(java.lang.String headerName, boolean allowDuplicateAttributes)
Gets the header value for the locale of this helper instance.Values will be search from the most specific to the less specific locale including unlocalized (empty locale) value.
- Parameters:
headerName
- the header to extract, must not benull
allowDuplicateAttributes
- true if the header allow duplicate attributes- Returns:
- the header value, never
null
-
getHeaderAsString
public java.lang.String getHeaderAsString(java.lang.String headerName)
Gets the header value for the locale of this helper instance.Values will be search from the most specific to the less specific locale including unlocalized (empty locale) value.
- Parameters:
headerName
- the header to extract, must not benull
- Returns:
- the header value, never
null
-
-