com.atlassian.confluence.plugin.descriptor
Class DefaultFactoryModuleDescriptor<T>

java.lang.Object
  extended by com.atlassian.plugin.descriptors.AbstractModuleDescriptor<T>
      extended by com.atlassian.confluence.plugin.descriptor.DefaultFactoryModuleDescriptor<T>
Type Parameters:
T -
All Implemented Interfaces:
com.atlassian.plugin.ModuleDescriptor<T>, com.atlassian.plugin.Resourced, com.atlassian.plugin.StateAware
Direct Known Subclasses:
BackupRestoreProviderModuleDescriptor, MacroMetadataModuleDescriptor, ModelMetadataProviderModuleDescriptor

public abstract class DefaultFactoryModuleDescriptor<T>
extends com.atlassian.plugin.descriptors.AbstractModuleDescriptor<T>

An implementation that uses the default module factory to produce modules. Implementing classes should implement getModule and delegate to getModuleFromProvider. The plugin system uses the return type of getModule to determine the class of the module that this descriptor produces.


Field Summary
 
Fields inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
key, moduleClass, moduleClassName, moduleFactory, name, plugin, resources, singleton
 
Constructor Summary
protected DefaultFactoryModuleDescriptor(com.atlassian.plugin.module.ModuleFactory moduleFactory)
           
 
Method Summary
 void disabled()
           
 void enabled()
           
abstract  T getModule()
          Implementing classes should implement this method and call getModuleFromProvider, this is required as AbstractModuleDescriptor.getModuleReturnClass() uses the return type of this method to determine the module class.
protected  T getModuleFromProvider()
           
 void init(com.atlassian.plugin.Plugin plugin, org.dom4j.Element element)
           
 
Methods inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
assertModuleClassImplements, checkPermissions, destroy, destroy, equals, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getModuleClassName, getName, getParams, getPlugin, getPluginKey, getRequiredPermissions, getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation, hashCode, isEnabledByDefault, isSingleton, isSingletonByDefault, isSystemModule, loadClass, loadClass, provideValidationRules, satisfiesMinJavaVersion, setPlugin, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultFactoryModuleDescriptor

protected DefaultFactoryModuleDescriptor(com.atlassian.plugin.module.ModuleFactory moduleFactory)
Method Detail

init

public void init(com.atlassian.plugin.Plugin plugin,
                 org.dom4j.Element element)
          throws com.atlassian.plugin.PluginParseException
Specified by:
init in interface com.atlassian.plugin.ModuleDescriptor<T>
Overrides:
init in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<T>
Throws:
com.atlassian.plugin.PluginParseException

getModule

public abstract T getModule()
Implementing classes should implement this method and call getModuleFromProvider, this is required as AbstractModuleDescriptor.getModuleReturnClass() uses the return type of this method to determine the module class. The JVM's type erasure means that it must be implemented with a non-generic type for getModuleReturnClass() to succeed.

Specified by:
getModule in interface com.atlassian.plugin.ModuleDescriptor<T>
Specified by:
getModule in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<T>

getModuleFromProvider

protected T getModuleFromProvider()

enabled

public void enabled()
Specified by:
enabled in interface com.atlassian.plugin.StateAware
Overrides:
enabled in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<T>

disabled

public void disabled()
Specified by:
disabled in interface com.atlassian.plugin.StateAware
Overrides:
disabled in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<T>


Copyright © 2003-2014 Atlassian. All Rights Reserved.