Class PluginDescription

  • All Implemented Interfaces:
    java.lang.Comparable<PluginDescription>

    public class PluginDescription
    extends java.lang.Object
    implements java.lang.Comparable<PluginDescription>
    Class to hold meta information about a plugin, derived from meta-data attached to each Plugin using a @PluginInfo annotation.
    • Method Detail

      • getPluginDescription

        public static PluginDescription getPluginDescription​(java.lang.Class<? extends Plugin> c)
        Fetches the PluginDescription for the specified Plugin class.

        If the PluginDescription is found in the static cache, it is returned directly, otherwise a new instance is created (using annotation data attached to the Plugin class) and it is cached for later use.

        Parameters:
        c - Plugin's class
        Returns:
        PluginDescription
      • isSlowInstallation

        public boolean isSlowInstallation()
        Returns true if this plugin requires a noticeable amount of time to load when installed.
        Returns:
      • getShortDescription

        public java.lang.String getShortDescription()
        Set the short description for what the plugin does.
        Returns:
        short description
      • getSourceLocation

        public java.lang.String getSourceLocation()
        Get the location for the source file for the plugin.
        Returns:
        path to the source file
      • isInCategory

        public boolean isInCategory​(java.lang.String parentCategory)
        Return whether the plugin is in the given category.
        Parameters:
        parentCategory - category to check
        Returns:
        true if the plugin is in the category
      • getName

        public java.lang.String getName()
        Return the name of the plugin.
      • getModuleName

        public java.lang.String getModuleName()
        Return the type for the plugin: CORE, CONTRIB, PROTOTYPE, or DEVELOP. Within a type, plugins are grouped by category.
        Returns:
        the type (or null if there is no module)
      • getPluginClass

        public java.lang.Class<? extends Plugin> getPluginClass()
        Return the class of the plugin.
        Returns:
        plugin class object
      • getDescription

        public java.lang.String getDescription()
        Return the description of the plugin.
        Returns:
        "<None>" if no description was specified
      • getCategory

        public java.lang.String getCategory()
        Return the category for the plugin.
        Returns:
        the category
      • getStatus

        public PluginStatus getStatus()
        Returns the development status of the plugin.
      • getServicesRequired

        public java.util.List<java.lang.Class<?>> getServicesRequired()
      • getServicesProvided

        public java.util.List<java.lang.Class<?>> getServicesProvided()
      • getEventsConsumed

        public java.util.List<java.lang.Class<? extends PluginEvent>> getEventsConsumed()
      • getEventsProduced

        public java.util.List<java.lang.Class<? extends PluginEvent>> getEventsProduced()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • createPluginDescription

        @Deprecated
        public static PluginDescription createPluginDescription​(java.lang.Class<?> pluginClass,
                                                                PluginStatus status,
                                                                java.lang.String pluginPackage,
                                                                java.lang.String category,
                                                                java.lang.String shortDescription,
                                                                java.lang.String description)
        Deprecated.
        Constructs a new PluginDescription for the given plugin class.

        Deprecated, use @PluginInfo instead.

        Parameters:
        pluginClass - the class of the plugin
        status - the status, UNSTABLE, STABLE, RELEASED, DEBUG, or EXAMPLE
        pluginPackage - the package to which the plugin belongs (see PluginPackage subclasses for examples)
        category - the category to which the plugin belongs (see PluginCategoryNames
        shortDescription - a brief description of what the plugin does
        description - the long description of what the plugin does
        Returns:
        the new (or cached) PluginDescription
      • createPluginDescription

        @Deprecated
        public static PluginDescription createPluginDescription​(java.lang.Class<?> pluginClassParam,
                                                                PluginStatus status,
                                                                java.lang.String pluginPackage,
                                                                java.lang.String category,
                                                                java.lang.String shortDescription,
                                                                java.lang.String description,
                                                                boolean isSlowInstallation)
        Deprecated.
        , use @PluginInfo instead.
        Constructs a new PluginDescription for the given plugin class.

        Parameters:
        pluginClassParam - the class of the plugin
        status - the status, UNSTABLE, STABLE, RELEASED, DEBUG, or EXAMPLE
        pluginPackage - the package to which the plugin belongs (see PluginPackage subclasses for examples)
        category - the category to which the plugin belongs (see PluginCategoryNames
        shortDescription - a brief description of what the plugin does
        description - the long description of what the plugin does
        isSlowInstallation - true signals that this plugin loads slowly
        Returns:
        the new (or cached) PluginDescription