com.atlassian.renderer.v2.plugin
Class RendererComponentModuleDescriptor

java.lang.Object
  extended by com.atlassian.plugin.descriptors.AbstractModuleDescriptor
      extended by com.atlassian.renderer.v2.plugin.RendererComponentModuleDescriptor
All Implemented Interfaces:
com.atlassian.plugin.ModuleDescriptor, com.atlassian.plugin.Resourced, com.atlassian.plugin.StateAware, com.atlassian.plugin.web.descriptors.WeightedDescriptor

public class RendererComponentModuleDescriptor
extends com.atlassian.plugin.descriptors.AbstractModuleDescriptor
implements com.atlassian.plugin.web.descriptors.WeightedDescriptor

A module descriptor for pluggable renderer components. Renderer component modules actually configure a RendererComponentFactory, rather than returning the component directly, to allow for more flexible configuration of different component types.

Components are weighted, and are executed from lowest weight to highest.

For simple components, you can instantiate the component directly:

<renderer-component key="mycomponent" weight="10" class="com.example.MyComponent">

For more complex components, you can defer component creation by specifying an instance of RendererComponentFactory as the module class. Any standard module parameter will be included in the factory's create method's parameter map.

<renderer-component key="mycomponent" weight="20" class="com.example.InlineComponentFactory>
    <param name="style">emphasis</param>
    <param name="markup">_</param>
 &;t;/renderer-component>

 

Applications may want to override the instantiateModuleClass method on this class to create factories via their component manager.


Field Summary
 
Fields inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
plugin, resources, singleton
 
Constructor Summary
RendererComponentModuleDescriptor()
           
 
Method Summary
 void enabled()
           
 Object getModule()
           
 int getWeight()
           
 void init(com.atlassian.plugin.Plugin plugin, org.dom4j.Element element)
           
protected  Object instantiateComponentClass()
          Create a new instance of the module class.
 
Methods inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
assertModuleClassImplements, destroy, disabled, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getName, getParams, getPlugin, getPluginKey, getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation, isEnabledByDefault, isSingleton, isSingletonByDefault, isSystemModule, loadClass, loadClass, satisfiesMinJavaVersion, setPlugin, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RendererComponentModuleDescriptor

public RendererComponentModuleDescriptor()
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
Overrides:
init in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
Throws:
com.atlassian.plugin.PluginParseException

enabled

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

getModule

public Object getModule()
Specified by:
getModule in interface com.atlassian.plugin.ModuleDescriptor
Specified by:
getModule in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor

getWeight

public int getWeight()
Specified by:
getWeight in interface com.atlassian.plugin.web.descriptors.WeightedDescriptor

instantiateComponentClass

protected Object instantiateComponentClass()
Create a new instance of the module class. Applications will probably want to override this method to perform instantiation through their component manager of choice.

Returns:
a new instance of the module class
See Also:
AbstractModuleDescriptor.getModuleClass()


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.