Interpretation of the org. osgi. Framework. Bundle class

Source: Internet
Author: User

Bundle provides information for obtaining plug-ins. You can use the following method to obtain the plug-in information.
Platform. getbundle (symbolicname );
For example
Bundle bundle = platform. getbundle ("org. Eclipse. UI. Views ");
1. Bundle. getentry ("/"); ---- obtain the URL of the plug-in installation directory

2. Bundle. getsymbolicname () ---- return a unique plug-in identifier (string type), consistent with the bundle-symbolicname statement in the manifest. MF File

3. Bundle. getheaders () ---- return the dictionary of the header and value defined by the menifest. MF file of the plug-in (key-Value Pair)
This key-value pair can be enumerated and printed.
For example:
Bundle-Name: bundle. getheaders (). Get ("bundle-name"); // return the plug-in name.
Version: bundle. getheaders (). Get ("bundle-version") // return the plug-in version.

4. Bundle. getstate () ---- return the current status of the plug-in. constants corresponding to the status value can be found in the bundle class, such as bundle. Active and bundle. starting.

5. Bundle. getbundleid () ---- unique identifier of the returned plug-in (long type), which is allocated by ECLIPSE during the installation package.

6. Platform. getresourcebundle (bundle): return the plug-in resource package object (Java. util. resourcebundle) corresponding to the current region ).
The information in this package object will be stored as the plugin. properties file in the plug-in installation directory after the plug-in is released.

 

// Pending

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.