Package biz.aQute.bnd.reporter.helpers
Class ManifestHelper
- java.lang.Object
-
- biz.aQute.bnd.reporter.helpers.ManifestHelper
-
public class ManifestHelper extends java.lang.ObjectAn helper to extract manifest headers taking into account the localization.
-
-
Field Summary
Fields Modifier and Type Field Description private LocaleHelper_loHelperprivate java.util.jar.Manifest_manifestprivate static java.lang.StringDEFAULT_LOCALIZATION_BASE
-
Constructor Summary
Constructors Modifier Constructor Description privateManifestHelper(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 ManifestHelpercreateIfPresent(Jar jar, java.util.Locale locale)Create aManifestHelperif the specified jar contains a manifest, otherwise returnnull.ParametersgetHeader(java.lang.String headerName, boolean allowDuplicateAttributes)Gets the header value for the locale of this helper instance.java.lang.StringgetHeaderAsString(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 aManifestHelperif the specified jar contains a manifest, otherwise returnnull.- Parameters:
jar- the jar, must not benulllocale- the locale, must not benull- Returns:
- the helper or
nullif 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 benullallowDuplicateAttributes- 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
-
-