Class PluginDescriptor

java.lang.Object
com.nomagic.magicdraw.plugins.PluginDescriptor

@OpenApiAll public class PluginDescriptor extends Object
The plugin descriptor class. Contains all information about plugin. This information is taken from plugin.xml file.
  • Constructor Details

    • PluginDescriptor

      public PluginDescriptor()
  • Method Details

    • setClassName

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

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

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

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

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

      public 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(String name)
      Sets the name of the plugin.
      Parameters:
      name - the plugin name.
    • getName

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

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

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

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

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

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

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

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

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

      public void setPluginDirectory(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 File getPluginDirectory()
      Returns the plugin installation directory. This is a directory there plugin descriptor xml file was found.
      Returns:
      the plugin directory.
    • getRequiresPlugins

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

      public void addRequiredPlugin(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)
      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

      public PluginDescriptor.ClassLookupStrategy getClassLookupStrategy()
      Get class lookup strategy.
      Returns:
      lookup strategy.
    • setClassLookupStrategy

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

      public void addVMOption(String option)
      Add vm option.
      Parameters:
      option - a new vm option.
    • getVmOptions

      public Collection<String> getVmOptions()
      Get all vm option that should be used when loading the plugin.
      Returns:
      a collection of vm options.
    • toString

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