Package com.nomagic.magicdraw.plugins
Class PluginDescriptor
java.lang.Object
com.nomagic.magicdraw.plugins.PluginDescriptor
The plugin descriptor class.
Contains all information about plugin. This information is taken from
plugin.xml file.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumClass lookup strategy. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequiredPlugin(String pluginID, RequiredPlugin requiredPlugin) Adds record about required plugin.voidaddVMOption(String option) Add vm option.Get class lookup strategy.Returns plugin class name.getID()Returns plugin id.intReturns plugin internal version numberReturns plugin license id.getName()Returns plugin name.Returns the plugin installation directory.Returns plugin provider.Returns the required MagicDraw Open API version.Returns record about required plugins.URL[]Returns an array of required jars for this plugin.Return plugin version.Get all vm option that should be used when loading the plugin.booleanReturns true, if this plugin is enabled by user.booleanisLoaded()Returns true, if this plugin is loaded.booleanChecks if plugin needs separate classloader.voidsetClassLookupStrategy(PluginDescriptor.ClassLookupStrategy lookupStrategy) Set class lookup strategy.voidsetClassName(String aClass) Sets plugin class name.voidsetEnabled(boolean enabled) Sets enabled flag.voidSets plugin id.voidsetInternalVersion(int internalVersion) Sets plugin internal version numbervoidsetLicenseID(String id) Sets plugin license id.voidsetLoaded(boolean loaded) Sets loaded flag.voidSets the name of the plugin.voidsetPluginDirectory(File directory) Sets the plugin installation directory.voidsetProvider(String provider) Sets plugin provider.voidsetRequiresAPI(String version) Sets the required MagicDraw Open API version.voidsetRuntimeLibraries(URL[] libraries) Sets an array of required jars for this plugin.voidsetSeparateClassloader(boolean separateClassloader) Set to use separate classloader.voidsetVersion(String version) Sets the plugin version.toString()Provides some useful information about this class attributes.
-
Constructor Details
-
PluginDescriptor
public PluginDescriptor()
-
-
Method Details
-
setClassName
Sets plugin class name.- Parameters:
aClass- the plugin class name.
-
getClassName
Returns plugin class name.- Returns:
- plugin class name.
-
setID
Sets plugin id.- Parameters:
id- the plugin id.
-
getID
Returns plugin id.- Returns:
- plugins id.
-
setLicenseID
Sets plugin license id.- Parameters:
id- the plugin license id.
-
getLicenseID
Returns plugin license id.- Returns:
- plugins license id.
-
getInternalVersion
public int getInternalVersion()Returns plugin internal version number- Returns:
- internal version number
-
setInternalVersion
public void setInternalVersion(int internalVersion) Sets plugin internal version number- Parameters:
internalVersion- plugin internal version number
-
setName
Sets the name of the plugin.- Parameters:
name- the plugin name.
-
getName
Returns plugin name.- Returns:
- name of the plugin.
-
setProvider
Sets plugin provider.- Parameters:
provider- the plugin provider.
-
getProvider
Returns plugin provider.- Returns:
- the plugin provider name(company or person).
-
setRequiresAPI
Sets the required MagicDraw Open API version.- Parameters:
version- the required version number. Must be double.
-
getRequiresAPI
Returns the required MagicDraw Open API version.- Returns:
- the required version number.
-
setRuntimeLibraries
Sets an array of required jars for this plugin.- Parameters:
libraries- the array of required libraries.
-
getRuntimeLibraries
Returns an array of required jars for this plugin.- Returns:
- the array of required libraries.
-
setVersion
Sets the plugin version.- Parameters:
version- the plugin version.
-
getVersion
Return plugin version.- Returns:
- the plugin version.
-
setPluginDirectory
Sets the plugin installation directory. This is a directory there plugin descriptor xml file was found.- Parameters:
directory- the plugin directory.
-
getPluginDirectory
Returns the plugin installation directory. This is a directory there plugin descriptor xml file was found.- Returns:
- the plugin directory.
-
getRequiresPlugins
Returns record about required plugins.- Returns:
- map of required plugins(key - plugin id, value - required plugin).
-
addRequiredPlugin
Adds record about required plugin.- Parameters:
pluginID- the id of the plugin.requiredPlugin- the required plugin descriptor
-
isEnabled
public boolean isEnabled()Returns true, if this plugin is enabled by user.- Returns:
- true, if this plugin is enabled by user.
-
setEnabled
public void setEnabled(boolean enabled) Sets enabled flag.- Parameters:
enabled- the new value of enabled flag.
-
isLoaded
public boolean isLoaded()Returns true, if this plugin is loaded.- Returns:
- true, if this plugin is loaded.
-
setLoaded
public void setLoaded(boolean loaded) Sets loaded flag.- Parameters:
loaded- the new value of loaded flag.
-
setSeparateClassloader
public void setSeparateClassloader(boolean separateClassloader) Set to use separate classloader.- Parameters:
separateClassloader- use separate classloader
-
isSeparateClassloader
public boolean isSeparateClassloader()Checks if plugin needs separate classloader.- Returns:
- true if plugin needs separate classloader.
-
getClassLookupStrategy
Get class lookup strategy.- Returns:
- lookup strategy.
-
setClassLookupStrategy
Set class lookup strategy.- Parameters:
lookupStrategy- lookup strategy.
-
addVMOption
Add vm option.- Parameters:
option- a new vm option.
-
getVmOptions
Get all vm option that should be used when loading the plugin.- Returns:
- a collection of vm options.
-
toString
Provides some useful information about this class attributes.
-