Class OSGiBundleParser
java.lang.Object
org.datanucleus.plugin.OSGiBundleParser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringgetBundleName(Dictionary<String, String> headers, String defaultValue) Accessor for the Bundle-Name from the manifest.mf fileprivate static StringgetBundleSymbolicName(Dictionary<String, String> headers, String defaultValue) Accessor for the Bundle-SymbolicName from the manifest.mf fileprivate static StringgetBundleVendor(Dictionary<String, String> headers, String defaultValue) Accessor for the Bundle-Vendor from the manifest.mf fileprivate static StringgetBundleVersion(Dictionary<String, String> headers, String defaultValue) Accessor for the Bundle-Version from the manifest.mf filestatic DocumentBuilderConvenience method to create a document builder for parsing.private static StringgetHeaderValue(Dictionary<String, String> headers, String key, String defaultValue) private static List<Bundle.BundleDescription> getRequireBundle(Dictionary<String, String> headers) Accessor for the Bundle-Name from the manifest.mf fileprivate static List<ExtensionPoint> parseExtensionPoints(Element rootElement, Bundle plugin, org.osgi.framework.Bundle osgiBundle) Method to parse ExtensionPoints from plug-in fileparseExtensions(Element rootElement, Bundle plugin, org.osgi.framework.Bundle osgiBundle) Method to parse Extensions from plug-in filestatic BundleparseManifest(org.osgi.framework.Bundle osgiBundle) static List[]parsePluginElements(DocumentBuilder db, PluginRegistry mgr, URL fileUrl, Bundle plugin, org.osgi.framework.Bundle osgiBundle) Method to parse Extensions in plug-in file.
-
Field Details
-
dbFactory
-
-
Constructor Details
-
OSGiBundleParser
public OSGiBundleParser()
-
-
Method Details
-
parseManifest
-
getRequireBundle
Accessor for the Bundle-Name from the manifest.mf file- Parameters:
headers- manifest headers- Returns:
- the Set with BundleDescription
-
parseExtensionPoints
private static List<ExtensionPoint> parseExtensionPoints(Element rootElement, Bundle plugin, org.osgi.framework.Bundle osgiBundle) Method to parse ExtensionPoints from plug-in file- Parameters:
rootElement- the root element of the plugin xmlplugin- the plugin bundleosgiBundle- The bundle- Returns:
- a List of extensionPoints, if any
- Throws:
NucleusException- if an error occurs during parsing
-
parseExtensions
private static List<Extension> parseExtensions(Element rootElement, Bundle plugin, org.osgi.framework.Bundle osgiBundle) Method to parse Extensions from plug-in file- Parameters:
rootElement- the root element of the plugin xmlplugin- the plugin bundleosgiBundle- the bundle- Returns:
- a List of extensions, if any
- Throws:
NucleusException- if an error occurs during parsing
-
getHeaderValue
-
getBundleSymbolicName
Accessor for the Bundle-SymbolicName from the manifest.mf file- Parameters:
headers- Manifest headersdefaultValue- a default value, in case no symbolic name found in manifest- Returns:
- the bundle symbolic name
-
getBundleName
Accessor for the Bundle-Name from the manifest.mf file- Parameters:
headers- manifest headersdefaultValue- a default value, in case no name found in manifest- Returns:
- the bundle name
-
getBundleVendor
Accessor for the Bundle-Vendor from the manifest.mf file- Parameters:
headers- manifest headersdefaultValue- a default value, in case no vendor found in manifest- Returns:
- the bundle vendor
-
getBundleVersion
Accessor for the Bundle-Version from the manifest.mf file- Parameters:
headers- the manifest headersdefaultValue- a default value, in case no version found in manifest- Returns:
- the bundle version
-
parsePluginElements
public static List[] parsePluginElements(DocumentBuilder db, PluginRegistry mgr, URL fileUrl, Bundle plugin, org.osgi.framework.Bundle osgiBundle) Method to parse Extensions in plug-in file.- Parameters:
db- DocumentBuilder to use for parsingmgr- the PluginManagerfileUrl- URL of the plugin.xml fileplugin- The BundleosgiBundle- The OSGi Bundle- Returns:
- array of 2 elements. first element is a List of extensionPoints, and 2nd element is a List of Extension
- Throws:
NucleusException- if an error occurs during parsing
-
getDocumentBuilder
Convenience method to create a document builder for parsing.- Returns:
- The document builder
- Throws:
NucleusException- if an error occurs creating the instance
-