Package org.datanucleus.plugin
Class PluginParser
java.lang.Object
org.datanucleus.plugin.PluginParser
Parser for "manifest.mf" and "plugin.xml" files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Parser for a list of Bundle-Description -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String
getBundleName
(Manifest mf, String defaultValue) Accessor for the Bundle-Name from the manifest.mf fileprivate static String
getBundleSymbolicName
(Manifest mf, String defaultValue) Accessor for the Bundle-SymbolicName from the manifest.mf fileprivate static String
getBundleVendor
(Manifest mf, String defaultValue) Accessor for the Bundle-Vendor from the manifest.mf fileprivate static String
getBundleVersion
(Manifest mf, String defaultValue) Accessor for the Bundle-Version from the manifest.mf filestatic DocumentBuilder
Convenience method to create a document builder for parsing.private static List
<Bundle.BundleDescription> Accessor for the Bundle-Name from the manifest.mf filestatic ConfigurationElement
parseConfigurationElement
(Extension ex, Element element, ConfigurationElement parent) Parses the current element and children, creating a ConfigurationElement objectprivate static List
<ExtensionPoint> parseExtensionPoints
(Element rootElement, Bundle plugin, ClassLoaderResolver clr) Method to parse ExtensionPoints from plug-in fileparseExtensions
(Element rootElement, Bundle plugin, ClassLoaderResolver clr) Method to parse Extensions from plug-in filestatic Bundle
parseManifest
(Manifest mf, URL fileUrl) static List[]
parsePluginElements
(DocumentBuilder db, PluginRegistry mgr, URL fileUrl, Bundle plugin, ClassLoaderResolver clr) Method to parse Extensions in plug-in file.static Bundle.BundleVersionRange
parseVersionRange
(String interval) Parse a Version Range as per OSGi spec 3.0 $3.2.5
-
Field Details
-
dbFactory
-
-
Constructor Details
-
PluginParser
PluginParser()
-
-
Method Details
-
parseManifest
-
getRequireBundle
Accessor for the Bundle-Name from the manifest.mf file- Parameters:
mf
- the manifest- Returns:
- the Set with BundleDescription
-
parseExtensionPoints
private static List<ExtensionPoint> parseExtensionPoints(Element rootElement, Bundle plugin, ClassLoaderResolver clr) Method to parse ExtensionPoints from plug-in file- Parameters:
rootElement
- the root element of the plugin xmlplugin
- the plugin bundleclr
- the ClassLoaderResolver- 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, ClassLoaderResolver clr) Method to parse Extensions from plug-in file- Parameters:
rootElement
- the root element of the plugin xmlplugin
- the plugin bundleclr
- the ClassLoaderResolver- Returns:
- a List of extensions, if any
- Throws:
NucleusException
- if an error occurs during parsing
-
getBundleSymbolicName
Accessor for the Bundle-SymbolicName from the manifest.mf file- Parameters:
mf
- the manifestdefaultValue
- 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:
mf
- the manifestdefaultValue
- 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:
mf
- the manifestdefaultValue
- 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:
mf
- the manifestdefaultValue
- 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, ClassLoaderResolver clr) Method to parse Extensions in plug-in file.- Parameters:
db
- DocumentBuilder to use for parsingmgr
- the PluginManagerfileUrl
- URL of the plugin.xml fileclr
- the ClassLoaderResolver- 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
-
parseConfigurationElement
public static ConfigurationElement parseConfigurationElement(Extension ex, Element element, ConfigurationElement parent) Parses the current element and children, creating a ConfigurationElement object- Parameters:
ex
- theExtension
element
- the current elementparent
- the parent. null if the parent is Extension- Returns:
- the ConfigurationElement for the element
-
parseVersionRange
Parse a Version Range as per OSGi spec 3.0 $3.2.5- Parameters:
interval
- the interval string- Returns:
-