Class PluginDescriptor


  • @OpenApiAll
    public class PluginDescriptor
    extends java.lang.Object
    The plugin descriptor class. Contains all information about plugin. This information is taken from plugin.xml file.
    • Field Detail

      • mPluginDirectory

        private java.io.File mPluginDirectory
        The plugin installation directory.
      • mRuntimeLibraries

        private java.net.URL[] mRuntimeLibraries
        The plugin runtime libraries(the jar files to be used in URLClassLoader).
      • mID

        private java.lang.String mID
        The plugin id.
      • mLicenseID

        private java.lang.String mLicenseID
        The plugin license id.
      • mName

        private java.lang.String mName
        The plugin name.
      • mVersion

        private java.lang.String mVersion
        The plugin version.
      • mInternalVersion

        private int mInternalVersion
        The plugin internal version.
      • mProvider

        private java.lang.String mProvider
        The plugin provider name.
      • mRequiresAPI

        @CheckForNull
        private java.lang.String mRequiresAPI
        Version of MagicDraw plugin requires. If API version is smaller, plugin will not be loaded.
      • mRequiresPlugins

        private final java.util.HashMap<java.lang.String,​RequiredPlugin> mRequiresPlugins
        The required plugins. Structure is pluginID-version
      • mClass

        private java.lang.String mClass
        The plugin class.
      • mEnabled

        private boolean mEnabled
        Is enabled.
      • mLoaded

        private boolean mLoaded
        Is loaded.
      • mSeparateClassloader

        private boolean mSeparateClassloader
        Plugin needs separate classloader
      • mClassLookupStrategy

        private PluginDescriptor.ClassLookupStrategy mClassLookupStrategy
        If plugin uses separate class loader, you can specify strategy how classes should be located
    • Constructor Detail

      • PluginDescriptor

        public PluginDescriptor()
    • Method Detail

      • setClassName

        public void setClassName​(java.lang.String aClass)
        Sets plugin class name.
        Parameters:
        aClass - the plugin class name.
      • getClassName

        public java.lang.String getClassName()
        Returns plugin class name.
        Returns:
        plugin class name.
      • setID

        public void setID​(java.lang.String id)
        Sets plugin id.
        Parameters:
        id - the plugin id.
      • getID

        public java.lang.String getID()
        Returns plugin id.
        Returns:
        plugins id.
      • setLicenseID

        public void setLicenseID​(java.lang.String id)
        Sets plugin license id.
        Parameters:
        id - the plugin license id.
      • getLicenseID

        public java.lang.String 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

        public void setName​(java.lang.String name)
        Sets the name of the plugin.
        Parameters:
        name - the plugin name.
      • getName

        public java.lang.String getName()
        Returns plugin name.
        Returns:
        name of the plugin.
      • setProvider

        public void setProvider​(java.lang.String provider)
        Sets plugin provider.
        Parameters:
        provider - the plugin provider.
      • getProvider

        public java.lang.String getProvider()
        Returns plugin provider.
        Returns:
        the plugin provider name(company or person).
      • setRequiresAPI

        public void setRequiresAPI​(@CheckForNull
                                   java.lang.String version)
        Sets the required MagicDraw Open API version.
        Parameters:
        version - the required version number. Must be double.
      • getRequiresAPI

        @CheckForNull
        public java.lang.String getRequiresAPI()
        Returns the required MagicDraw Open API version.
        Returns:
        the required version number.
      • setRuntimeLibraries

        public void setRuntimeLibraries​(java.net.URL[] libraries)
        Sets an array of required jars for this plugin.
        Parameters:
        libraries - the array of required libraries.
      • getRuntimeLibraries

        public java.net.URL[] getRuntimeLibraries()
        Returns an array of required jars for this plugin.
        Returns:
        the array of required libraries.
      • setVersion

        public void setVersion​(java.lang.String version)
        Sets the plugin version.
        Parameters:
        version - the plugin version.
      • getVersion

        public java.lang.String getVersion()
        Return plugin version.
        Returns:
        the plugin version.
      • setPluginDirectory

        public void setPluginDirectory​(java.io.File directory)
        Sets the plugin installation directory. This is a directory there plugin descriptor xml file was found.
        Parameters:
        directory - the plugin directory.
      • getPluginDirectory

        public java.io.File getPluginDirectory()
        Returns the plugin installation directory. This is a directory there plugin descriptor xml file was found.
        Returns:
        the plugin directory.
      • getRequiresPlugins

        public java.util.Map<java.lang.String,​RequiredPlugin> getRequiresPlugins()
        Returns record about required plugins.
        Returns:
        map of required plugins(key - plugin id, value - required plugin).
      • addRequiredPlugin

        public void addRequiredPlugin​(java.lang.String pluginID,
                                      RequiredPlugin requiredPlugin)
        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)
        Sets if use separate classloader.
        Parameters:
        separateClassloader - true if use separate classloader.
      • isSeparateClassloader

        public boolean isSeparateClassloader()
        Checks if plugin needs separate classloader.
        Returns:
        true if plugin needs separate classloader.
      • setClassLookupStrategy

        public void setClassLookupStrategy​(PluginDescriptor.ClassLookupStrategy lookupStrategy)
        Set class lookup strategy.
        Parameters:
        lookupStrategy - lookup strategy.
      • toString

        public java.lang.String toString()
        Provides some useful information about this class attributes.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation.