|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.plugin.descriptors.AbstractModuleDescriptor<T>
public abstract class AbstractModuleDescriptor<T>
| Field Summary | |
|---|---|
protected Plugin |
plugin
|
protected Resources |
resources
|
protected boolean |
singleton
|
| Constructor Summary | |
|---|---|
AbstractModuleDescriptor()
|
|
| Method Summary | |
|---|---|
protected void |
assertModuleClassImplements(java.lang.Class requiredModuleClazz)
Check that the module class of this descriptor implements a given interface, or extends a given class. |
void |
destroy(Plugin plugin)
Override this if your plugin needs to clean up when it's been removed. |
void |
disabled()
Disables the module descriptor. |
void |
enabled()
Enables the descriptor by loading the module class. |
java.lang.String |
getCompleteKey()
The complete key for this module, including the plugin key. |
java.lang.String |
getDescription()
A simple description of this descriptor. |
java.lang.String |
getDescriptionKey()
Key used to override ModuleDescriptor.getDescription() when using internationalisation. |
java.lang.String |
getI18nNameKey()
Key used to override ModuleDescriptor.getName() when using internationalisation. |
java.lang.String |
getKey()
The key for this module, unique within the plugin. |
java.lang.Float |
getMinJavaVersion()
|
abstract T |
getModule()
The particular module object created by this plugin. |
java.lang.Class<T> |
getModuleClass()
The class of the module this descriptor creates. |
java.lang.String |
getName()
A simple string name for this descriptor. |
java.util.Map |
getParams()
|
Plugin |
getPlugin()
|
java.lang.String |
getPluginKey()
The plugin key for this module, derived from the complete key |
ResourceDescriptor |
getResourceDescriptor(java.lang.String type,
java.lang.String name)
Deprecated. |
java.util.List<ResourceDescriptor> |
getResourceDescriptors()
|
java.util.List<ResourceDescriptor> |
getResourceDescriptors(java.lang.String type)
|
ResourceLocation |
getResourceLocation(java.lang.String type,
java.lang.String name)
|
void |
init(Plugin plugin,
org.dom4j.Element element)
Initialise a module given it's parent plugin and the XML element representing the module. |
boolean |
isEnabledByDefault()
Whether or not this plugin module is enabled by default. |
boolean |
isSingleton()
|
protected boolean |
isSingletonByDefault()
Override this method if you want your module descriptor to be or not be a singleton by default. |
boolean |
isSystemModule()
Whether or not this plugin module is a "system" plugin that shouldn't be made visible/disableable to the user |
protected void |
loadClass(Plugin plugin,
org.dom4j.Element element)
Deprecated. Since 2.1.0, use loadClass(Plugin,String) instead |
protected void |
loadClass(Plugin plugin,
java.lang.String clazz)
Override this for module descriptors which don't expect to be able to load a class successfully |
boolean |
satisfiesMinJavaVersion()
If a min java version has been specified this will return true if the running jvm is >= to the specified version. |
void |
setPlugin(Plugin plugin)
Sets the plugin for the ModuleDescriptor |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Plugin plugin
protected boolean singleton
protected Resources resources
| Constructor Detail |
|---|
public AbstractModuleDescriptor()
| Method Detail |
|---|
public void init(Plugin plugin,
org.dom4j.Element element)
throws PluginParseException
ModuleDescriptor
init in interface ModuleDescriptor<T>PluginParseException
protected void loadClass(Plugin plugin,
org.dom4j.Element element)
throws PluginParseException
loadClass(Plugin,String) instead
plugin - element -
PluginParseException
protected void loadClass(Plugin plugin,
java.lang.String clazz)
throws PluginParseException
plugin - clazz - The module class name to load
PluginParseExceptionpublic void destroy(Plugin plugin)
destroy in interface ModuleDescriptor<T>public boolean isEnabledByDefault()
ModuleDescriptor
isEnabledByDefault in interface ModuleDescriptor<T>public boolean isSystemModule()
ModuleDescriptor
isSystemModule in interface ModuleDescriptor<T>public boolean isSingleton()
protected boolean isSingletonByDefault()
Default is "true" - ie all plugin modules are singletons by default.
protected final void assertModuleClassImplements(java.lang.Class requiredModuleClazz)
throws PluginParseException
requiredModuleClazz - The class this module's class must implement or extend.
PluginParseException - If the module class does not implement or extend the given class.public java.lang.String getCompleteKey()
ModuleDescriptorFormat is plugin.key:module.key
getCompleteKey in interface ModuleDescriptor<T>public java.lang.String getPluginKey()
ModuleDescriptor
getPluginKey in interface ModuleDescriptor<T>public java.lang.String getKey()
ModuleDescriptor
getKey in interface ModuleDescriptor<T>public java.lang.String getName()
ModuleDescriptor
getName in interface ModuleDescriptor<T>public java.lang.Class<T> getModuleClass()
ModuleDescriptor
getModuleClass in interface ModuleDescriptor<T>public abstract T getModule()
ModuleDescriptor
getModule in interface ModuleDescriptor<T>public java.lang.String getDescription()
ModuleDescriptor
getDescription in interface ModuleDescriptor<T>public java.util.Map getParams()
getParams in interface ModuleDescriptor<T>public java.lang.String getI18nNameKey()
ModuleDescriptorModuleDescriptor.getName() when using internationalisation.
getI18nNameKey in interface ModuleDescriptor<T>public java.lang.String getDescriptionKey()
ModuleDescriptorModuleDescriptor.getDescription() when using internationalisation.
getDescriptionKey in interface ModuleDescriptor<T>public java.util.List<ResourceDescriptor> getResourceDescriptors()
getResourceDescriptors in interface Resourcedpublic java.util.List<ResourceDescriptor> getResourceDescriptors(java.lang.String type)
getResourceDescriptors in interface Resourced
public ResourceLocation getResourceLocation(java.lang.String type,
java.lang.String name)
getResourceLocation in interface Resourced
public ResourceDescriptor getResourceDescriptor(java.lang.String type,
java.lang.String name)
getResourceDescriptor in interface Resourcedpublic java.lang.Float getMinJavaVersion()
getMinJavaVersion in interface ModuleDescriptor<T>public boolean satisfiesMinJavaVersion()
ModuleDescriptor
satisfiesMinJavaVersion in interface ModuleDescriptor<T>public void setPlugin(Plugin plugin)
public Plugin getPlugin()
getPlugin in interface ModuleDescriptor<T>public java.lang.String toString()
toString in class java.lang.Objectpublic void enabled()
enabled in interface StateAwarepublic void disabled()
disabled in interface StateAware
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||