Package ghidra.framework.plugintool.util
Class PluginDescription
- java.lang.Object
-
- ghidra.framework.plugintool.util.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 eachPlugin
using a@PluginInfo
annotation.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description int
compareTo(PluginDescription other)
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.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.boolean
equals(java.lang.Object obj)
java.lang.String
getCategory()
Return the category for the plugin.java.lang.String
getDescription()
Return the description of the plugin.java.util.List<java.lang.Class<? extends PluginEvent>>
getEventsConsumed()
java.util.List<java.lang.Class<? extends PluginEvent>>
getEventsProduced()
java.lang.String
getModuleName()
Return the type for the plugin: CORE, CONTRIB, PROTOTYPE, or DEVELOP.java.lang.String
getName()
Return the name of the plugin.java.lang.Class<? extends Plugin>
getPluginClass()
Return the class of the plugin.static PluginDescription
getPluginDescription(java.lang.Class<? extends Plugin> c)
Fetches thePluginDescription
for the specified Plugin class.PluginPackage
getPluginPackage()
java.util.List<java.lang.Class<?>>
getServicesProvided()
java.util.List<java.lang.Class<?>>
getServicesRequired()
java.lang.String
getShortDescription()
Set the short description for what the plugin does.java.lang.String
getSourceLocation()
Get the location for the source file for the plugin.PluginStatus
getStatus()
Returns the development status of the plugin.int
hashCode()
boolean
isInCategory(java.lang.String parentCategory)
Return whether the plugin is in the given category.boolean
isSlowInstallation()
Returns true if this plugin requires a noticeable amount of time to load when installed.java.lang.String
toString()
-
-
-
Method Detail
-
getPluginDescription
public static PluginDescription getPluginDescription(java.lang.Class<? extends Plugin> c)
Fetches thePluginDescription
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.
-
getPluginPackage
public PluginPackage getPluginPackage()
-
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 classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(PluginDescription other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<PluginDescription>
-
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 pluginstatus
- the status, UNSTABLE, STABLE, RELEASED, DEBUG, or EXAMPLEpluginPackage
- the package to which the plugin belongs (seePluginPackage
subclasses for examples)category
- the category to which the plugin belongs (seePluginCategoryNames
shortDescription
- a brief description of what the plugin doesdescription
- 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 pluginstatus
- the status, UNSTABLE, STABLE, RELEASED, DEBUG, or EXAMPLEpluginPackage
- the package to which the plugin belongs (seePluginPackage
subclasses for examples)category
- the category to which the plugin belongs (seePluginCategoryNames
shortDescription
- a brief description of what the plugin doesdescription
- the long description of what the plugin doesisSlowInstallation
- true signals that this plugin loads slowly- Returns:
- the new (or cached) PluginDescription
-
-