Class ManifestParser
java.lang.Object
org.apache.felix.framework.util.manifestparser.ManifestParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final Stringprivate static final intprivate static final intprivate static final charprivate static final intprivate Stringprivate Stringprivate intprivate Stringprivate Versionprivate List<BundleCapability> private booleanprivate List<NativeLibraryClause> private booleanprivate final Loggerprivate List<BundleRequirement> private static final Map<Object, WeakReference<Object>> private static final intprivate static final int -
Constructor Summary
ConstructorsConstructorDescriptionManifestParser(Logger logger, Map<String, ?> configMap, BundleRevision owner, Map<String, String> headerMap) -
Method Summary
Modifier and TypeMethodDescriptionprivate static BundleCapabilityImpladdIdentityCapability(BundleRevision owner, Map<String, String> headerMap, BundleCapabilityImpl bundleCap) static List<BundleCapability> aliasSymbolicName(List<BundleCapability> caps, BundleRevision owner) private static SimpleFilterbuildFilterFromArray(String attributeName, String[] stringArray, int operation) private static List<ParsedHeaderClause> calculateImplicitImports(List<BundleCapability> exports, List<ParsedHeaderClause> imports) private static List<BundleCapability> calculateImplicitUses(List<BundleCapability> exports, List<ParsedHeaderClause> imports) private static charprivate static booleancheckExtensionBundle(Map<String, String> headerMap) private static List<BundleCapability> convertExports(List<ParsedHeaderClause> clauses, BundleRevision owner) private static List<BundleRequirement> convertImports(List<ParsedHeaderClause> clauses, BundleRevision owner) (package private) static List<BundleRequirement> convertNativeCode(BundleRevision owner, List<NativeLibraryClause> nativeLibraryClauses, boolean hasOptionalLibraryDirective) private static List<BundleCapability> convertProvideCapabilities(List<ParsedHeaderClause> clauses, BundleRevision owner) private static List<BundleRequirement> convertRequireCapabilities(List<ParsedHeaderClause> clauses, BundleRevision owner) private static List<BundleRequirementImpl> convertRequires(List<ParsedHeaderClause> clauses, BundleRevision owner) private intfirstSortedClause(List<NativeLibraryClause> clauseList) intprivate static StringThis method returns the selected native library metadata from the manifest.private static StringgetManifestVersion(Map<String, String> headerMap) private Stringprivate NativeLibraryClausebooleanstatic voidprivate static List<ParsedHeaderClause> normalizeCapabilityClauses(Logger logger, List<ParsedHeaderClause> clauses, String mv) private static List<ParsedHeaderClause> normalizeDynamicImportClauses(Logger logger, List<ParsedHeaderClause> clauses, String mv) private static List<ParsedHeaderClause> normalizeExportClauses(Logger logger, List<ParsedHeaderClause> clauses, String mv, String bsn, Version bv, boolean connectModule) private static List<ParsedHeaderClause> normalizeImportClauses(Logger logger, List<ParsedHeaderClause> clauses, String mv) private static List<ParsedHeaderClause> normalizeRequireClauses(Logger logger, List<ParsedHeaderClause> clauses, String mv) private voidparseActivationPolicy(Map<String, String> headerMap) private static List<BundleRequirement> parseBreeHeader(String header, BundleRevision owner) private static BundleCapabilityImplparseBundleSymbolicName(Logger logger, BundleRevision owner, Map<String, String> headerMap) parseDelimitedString(String value, String delim) parseDelimitedString(String value, String delim, boolean trim) Parses delimited string and returns an array containing the tokens.static List<BundleRequirement> parseDynamicImportHeader(Logger logger, BundleRevision owner, String header) static StringparseExtensionBundleHeader(String header) private static List<BundleRequirementImpl> parseFragmentHost(Logger logger, BundleRevision owner, Map<String, String> headerMap) private static List<NativeLibraryClause> parseLibraryStrings(Logger logger, List<String> libStrs) Parses native code manifest headers.private static List<ParsedHeaderClause> parseStandardHeader(String header)
-
Field Details
-
BUNDLE_LICENSE_HEADER
- See Also:
-
m_logger
-
m_configMap
-
m_headerMap
-
m_activationPolicy
private volatile int m_activationPolicy -
m_activationIncludeDir
-
m_activationExcludeDir
-
m_isExtension
private volatile boolean m_isExtension -
m_bundleSymbolicName
-
m_bundleVersion
-
m_capabilities
-
m_requirements
-
m_libraryClauses
-
m_libraryHeadersOptional
private volatile boolean m_libraryHeadersOptional -
objectCache
-
cache
-
EOF
private static final char EOF- See Also:
-
CLAUSE_START
private static final int CLAUSE_START- See Also:
-
PARAMETER_START
private static final int PARAMETER_START- See Also:
-
KEY
private static final int KEY- See Also:
-
DIRECTIVE_OR_TYPEDATTRIBUTE
private static final int DIRECTIVE_OR_TYPEDATTRIBUTE- See Also:
-
ARGUMENT
private static final int ARGUMENT- See Also:
-
VALUE
private static final int VALUE- See Also:
-
-
Constructor Details
-
ManifestParser
public ManifestParser(Logger logger, Map<String, ?> configMap, BundleRevision owner, Map<String, throws BundleExceptionString> headerMap) - Throws:
BundleException
-
-
Method Details
-
normalizeImportClauses
private static List<ParsedHeaderClause> normalizeImportClauses(Logger logger, List<ParsedHeaderClause> clauses, String mv) throws BundleException - Throws:
BundleException
-
parseDynamicImportHeader
public static List<BundleRequirement> parseDynamicImportHeader(Logger logger, BundleRevision owner, String header) throws BundleException - Throws:
BundleException
-
convertImports
private static List<BundleRequirement> convertImports(List<ParsedHeaderClause> clauses, BundleRevision owner) -
normalizeDynamicImportClauses
private static List<ParsedHeaderClause> normalizeDynamicImportClauses(Logger logger, List<ParsedHeaderClause> clauses, String mv) throws BundleException - Throws:
BundleException
-
convertRequireCapabilities
private static List<BundleRequirement> convertRequireCapabilities(List<ParsedHeaderClause> clauses, BundleRevision owner) throws BundleException - Throws:
BundleException
-
convertNativeCode
static List<BundleRequirement> convertNativeCode(BundleRevision owner, List<NativeLibraryClause> nativeLibraryClauses, boolean hasOptionalLibraryDirective) -
buildFilterFromArray
private static SimpleFilter buildFilterFromArray(String attributeName, String[] stringArray, int operation) -
normalizeCapabilityClauses
private static List<ParsedHeaderClause> normalizeCapabilityClauses(Logger logger, List<ParsedHeaderClause> clauses, String mv) throws BundleException - Throws:
BundleException
-
convertProvideCapabilities
private static List<BundleCapability> convertProvideCapabilities(List<ParsedHeaderClause> clauses, BundleRevision owner) throws BundleException - Throws:
BundleException
-
normalizeExportClauses
private static List<ParsedHeaderClause> normalizeExportClauses(Logger logger, List<ParsedHeaderClause> clauses, String mv, String bsn, Version bv, boolean connectModule) throws BundleException - Throws:
BundleException
-
convertExports
private static List<BundleCapability> convertExports(List<ParsedHeaderClause> clauses, BundleRevision owner) -
getManifestVersion
-
getManifestVersion
-
getActivationPolicy
public int getActivationPolicy() -
getActivationIncludeDirective
-
getActivationExcludeDirective
-
isExtension
public boolean isExtension() -
getSymbolicName
-
getBundleVersion
-
getCapabilities
-
getRequirements
-
getLibraries
This method returns the selected native library metadata from the manifest. The information is not the raw metadata from the manifest, but is the native library clause selected according to the OSGi native library clause selection policy. The metadata returned by this method will be attached directly to a module and used for finding its native libraries at run time. To inspect the raw native library metadata refer to getLibraryClauses().
This method returns one of three values:
- null - if the are no native libraries for this module; this may also indicate the native libraries are optional and did not match the current platform.
- Zero-length NativeLibrary array - if no matching native library clause was found; this bundle should not resolve.
- Nonzero-length NativeLibrary array - the native libraries associated with the matching native library clause.
- Returns:
- null if there are no native libraries, a zero-length array if no libraries matched, or an array of selected libraries.
-
getName
-
getSelectedLibraryClause
- Throws:
BundleException
-
firstSortedClause
-
calculateImplicitImports
private static List<ParsedHeaderClause> calculateImplicitImports(List<BundleCapability> exports, List<ParsedHeaderClause> imports) throws BundleException - Throws:
BundleException
-
calculateImplicitUses
private static List<BundleCapability> calculateImplicitUses(List<BundleCapability> exports, List<ParsedHeaderClause> imports) throws BundleException - Throws:
BundleException
-
checkExtensionBundle
- Throws:
BundleException
-
parseBundleSymbolicName
private static BundleCapabilityImpl parseBundleSymbolicName(Logger logger, BundleRevision owner, Map<String, String> headerMap) throws BundleException- Throws:
BundleException
-
addIdentityCapability
private static BundleCapabilityImpl addIdentityCapability(BundleRevision owner, Map<String, String> headerMap, BundleCapabilityImpl bundleCap) throws BundleException- Throws:
BundleException
-
parseFragmentHost
private static List<BundleRequirementImpl> parseFragmentHost(Logger logger, BundleRevision owner, Map<String, String> headerMap) throws BundleException- Throws:
BundleException
-
parseBreeHeader
-
getBreeVersionClause
-
normalizeRequireClauses
private static List<ParsedHeaderClause> normalizeRequireClauses(Logger logger, List<ParsedHeaderClause> clauses, String mv) -
convertRequires
private static List<BundleRequirementImpl> convertRequires(List<ParsedHeaderClause> clauses, BundleRevision owner) -
parseExtensionBundleHeader
- Throws:
BundleException
-
parseActivationPolicy
-
main
-
charAt
-
parseStandardHeader
-
parseDelimitedString
-
parseDelimitedString
Parses delimited string and returns an array containing the tokens. This parser obeys quotes, so the delimiter character will be ignored if it is inside of a quote. This method assumes that the quote character is not included in the set of delimiter characters.- Parameters:
value- the delimited string to parse.delim- the characters delimiting the tokens.- Returns:
- a list of string or an empty list if there are none.
-
parseLibraryStrings
private static List<NativeLibraryClause> parseLibraryStrings(Logger logger, List<String> libStrs) throws IllegalArgumentException Parses native code manifest headers.- Parameters:
libStrs- an array of native library manifest header strings from the bundle manifest.- Returns:
- an array of LibraryInfo objects for the passed in strings.
- Throws:
IllegalArgumentException
-
aliasSymbolicName
public static List<BundleCapability> aliasSymbolicName(List<BundleCapability> caps, BundleRevision owner)
-