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
Modifier and TypeClassDescriptionstatic enum
Class lookup strategy. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRequiredPlugin
(String pluginID, RequiredPlugin requiredPlugin) Adds record about required plugin.void
addVMOption
(String option) Add vm option.Get class lookup strategy.Returns plugin class name.getID()
Returns plugin id.int
Returns 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.boolean
Returns true, if this plugin is enabled by user.boolean
isLoaded()
Returns true, if this plugin is loaded.boolean
Checks if plugin needs separate classloader.void
setClassLookupStrategy
(PluginDescriptor.ClassLookupStrategy lookupStrategy) Set class lookup strategy.void
setClassName
(String aClass) Sets plugin class name.void
setEnabled
(boolean enabled) Sets enabled flag.void
Sets plugin id.void
setInternalVersion
(int internalVersion) Sets plugin internal version numbervoid
setLicenseID
(String id) Sets plugin license id.void
setLoaded
(boolean loaded) Sets loaded flag.void
Sets the name of the plugin.void
setPluginDirectory
(File directory) Sets the plugin installation directory.void
setProvider
(String provider) Sets plugin provider.void
setRequiresAPI
(String version) Sets the required MagicDraw Open API version.void
setRuntimeLibraries
(URL[] libraries) Sets an array of required jars for this plugin.void
setSeparateClassloader
(boolean separateClassloader) Set to use separate classloader.void
setVersion
(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.
-