com.atlassian.plugin.module
Class ClassPrefixModuleFactory

java.lang.Object
  extended by com.atlassian.plugin.module.ClassPrefixModuleFactory
All Implemented Interfaces:
ModuleFactory, PrefixModuleFactory

public class ClassPrefixModuleFactory
extends java.lang.Object
implements PrefixModuleFactory

The ClassModuleFactory creates a java bean for the given module class by using either the plugins container or the hostcontainer, depending if the plugin implements ContainerManagedPlugin. The returned bean class should have all constructor dependencies injected. However it is the containers responsibility to inject the dependencies.

The ClassModuleFactory expects the fully qualified name of the java class.

Since:
2.5.0

Field Summary
protected  HostContainer hostContainer
           
 
Fields inherited from interface com.atlassian.plugin.module.ModuleFactory
LEGACY_MODULE_FACTORY
 
Constructor Summary
ClassPrefixModuleFactory(HostContainer hostContainer)
           
 
Method Summary
<T> T
createModule(java.lang.String name, ModuleDescriptor<T> moduleDescriptor)
          Creates the module instance.
 java.lang.String getPrefix()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hostContainer

protected final HostContainer hostContainer
Constructor Detail

ClassPrefixModuleFactory

public ClassPrefixModuleFactory(HostContainer hostContainer)
Method Detail

createModule

public <T> T createModule(java.lang.String name,
                          ModuleDescriptor<T> moduleDescriptor)
               throws PluginParseException
Description copied from interface: ModuleFactory
Creates the module instance. The module class name can contain a prefix. The delimiter of the prefix and the class name is ':'. E.g.: 'bean:httpServletBean'. Which prefixes are supported depends on the registered com.atlassian.plugin.module.ModuleCreator. The prefix is case in-sensitive.

Specified by:
createModule in interface ModuleFactory
Parameters:
name - module class name, can contain a prefix followed by ":" and the class name. Cannot be null If no prefix provided a default behaviour is assumed how to create the module class.
moduleDescriptor - the ModuleDescriptor. Cannot be null
Returns:
an instantiated object of the module class.
Throws:
PluginParseException - If it failed to create the object.

getPrefix

public java.lang.String getPrefix()
Specified by:
getPrefix in interface PrefixModuleFactory
Returns:
the prefix the module factory expects to be matched to


Copyright © 2012 Atlassian. All Rights Reserved.