What is a plug-in fragment?
2013-07-12 16:16
183 查看
Sometimes it is useful to make part of a plug-in optional, allowing it to be installed, uninstalled, or updated independently from the rest of the plug-in. For example, a plug-in may have a library that is specific to a particular
operating system or windowing system or a language pack that adds translations for the plug-in’s messages. In these situations, you can create a fragment that is associated with a particular host plug-in. On disk, a fragment looks almost exactly the
same as a plug-in, except for a few differences.
A fragment appears much the same as a normal plug-in. A fragment can specify libraries, extensions, and other files. When it is loaded by the platform loader, a fragment is logically, but not physically, merged into the host plug-in. The end result is exactly
the same as if the fragment’s manifest were copied into the plug-in manifest, and all the files in the fragment directory appear as if they were located in the plug-in’s install directory. Thus, a runtime library supplied
by a fragment appears on the classpath of its host plug-in. In fact, a Java class in a fragment can be in the same package as a class in the host and will even have access to package-visible methods on the host’s classes. The methods find and openStream on Plugin,
which take as a parameter a path relative to the plug-in’s install directory, can be used to locate and read resources stored in the fragment install directory.
operating system or windowing system or a language pack that adds translations for the plug-in’s messages. In these situations, you can create a fragment that is associated with a particular host plug-in. On disk, a fragment looks almost exactly the
same as a plug-in, except for a few differences.
A fragment appears much the same as a normal plug-in. A fragment can specify libraries, extensions, and other files. When it is loaded by the platform loader, a fragment is logically, but not physically, merged into the host plug-in. The end result is exactly
the same as if the fragment’s manifest were copied into the plug-in manifest, and all the files in the fragment directory appear as if they were located in the plug-in’s install directory. Thus, a runtime library supplied
by a fragment appears on the classpath of its host plug-in. In fact, a Java class in a fragment can be in the same package as a class in the host and will even have access to package-visible methods on the host’s classes. The methods find and openStream on Plugin,
which take as a parameter a path relative to the plug-in’s install directory, can be used to locate and read resources stored in the fragment install directory.
相关文章推荐
- 1.1 What is the plug-in?
- What is CyclicBarrier in Java
- What is the most important thing in your life?
- What is the DD in java web application
- macro与inline的区别 What is the difference between macro and inline?
- What exactly is the difference between “pass by reference” in C and in C++?
- What is the best(funniest) comment in source code you have ever encountered?
- what is the difference between _source and _all in Elasticsearch
- what-is-a-metaclass-in-python
- what is app.use in NodeJS/Express
- The project is using an unsupported version of the Android Gradle plug-in
- what is ppa in linux Ubuntu添加PPA源
- This version of the rendering library is more recent than your version of ADT plug-in. Please update
- What is the purpose of @SmallTest, @MediumTest, and @LargeTest annotations in Android?
- What is the diference between putting a property on application.yml or bootstrap.yml in spring boot?
- What is the best way to paginate results in SQL Server
- What is the difference between _tmain() and main() in C++?
- What is the meaning of the word logits in TensorFlow?
- .replace(R.id.container, new User()).commit();/The method replace(int, Fragment) in the type FragmentTransaction is not app
- OpenStack: What is the difference between Block storage and Object storage?Also, In what way they ar