public class CustomMacroModuleDescriptor extends com.atlassian.plugin.descriptors.AbstractModuleDescriptor<com.atlassian.renderer.v2.macro.Macro> implements MacroModuleDescriptor, org.springframework.context.ApplicationContextAware, PluginModuleFactory<com.atlassian.renderer.v2.macro.Macro>, UserLocaleAware, MacroMetadataSource
Macro
,
Macro
plugin documentationConstructor and Description |
---|
CustomMacroModuleDescriptor(com.atlassian.plugin.module.ModuleFactory moduleFactory,
MacroMetadataParser macroMetadataParser) |
Modifier and Type | Method and Description |
---|---|
com.atlassian.renderer.v2.macro.Macro |
createModule() |
void |
disabled() |
void |
enabled() |
Macro.BodyType |
getBodyType()
Used by code that automatically converts a V2 macro to an XHTML macro.
|
String |
getHelp()
Returns the macro help as rendered HTML, or null if there is no help.
|
com.atlassian.plugin.elements.ResourceDescriptor |
getHelpDescriptor()
Returns the macro help descriptor, or null if there is no help.
|
String |
getHelpSection()
Returns the section of notation guide in which the macro help appears.
|
MacroMetadata |
getMacroMetadata() |
com.atlassian.renderer.v2.macro.Macro |
getModule()
Returns the macro defined by this module descriptor.
|
boolean |
hasBody()
A method that determines the return value of
Macro.hasBody() without
initialising the module (or macro). |
boolean |
hasHelp()
Returns true if the macro has help, otherwise false.
|
void |
init(com.atlassian.plugin.Plugin plugin,
org.dom4j.Element element) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setI18NBeanFactory(I18NBeanFactory i18NBeanFactory) |
assertModuleClassImplements, checkPermissions, destroy, destroy, equals, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getModuleClassName, getName, getParams, getPlugin, getPluginKey, getRequiredPermissions, getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation, getScopeKey, hashCode, isBroken, isEnabled, isEnabledByDefault, isSingleton, isSingletonByDefault, isSystemModule, loadClass, loadClass, provideValidationRules, satisfiesMinJavaVersion, setBroken, setPlugin, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
destroy, destroy, equals, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getName, getParams, getPlugin, getPluginKey, hashCode, isBroken, isEnabled, isEnabledByDefault, isSystemModule, satisfiesMinJavaVersion, setBroken
public CustomMacroModuleDescriptor(com.atlassian.plugin.module.ModuleFactory moduleFactory, MacroMetadataParser macroMetadataParser)
public void init(com.atlassian.plugin.Plugin plugin, org.dom4j.Element element) throws com.atlassian.plugin.PluginParseException
init
in interface com.atlassian.plugin.ModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>
init
in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>
com.atlassian.plugin.PluginParseException
public com.atlassian.renderer.v2.macro.Macro getModule()
getModule
in interface com.atlassian.plugin.ModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>
getModule
in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>
public com.atlassian.renderer.v2.macro.Macro createModule()
createModule
in interface PluginModuleFactory<com.atlassian.renderer.v2.macro.Macro>
public void enabled()
enabled
in interface com.atlassian.plugin.StateAware
enabled
in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>
public void disabled()
disabled
in interface com.atlassian.plugin.StateAware
disabled
in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>
public boolean hasHelp()
public String getHelpSection()
public com.atlassian.plugin.elements.ResourceDescriptor getHelpDescriptor()
getHelp()
public String getHelp()
getHelpDescriptor()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public MacroMetadata getMacroMetadata()
getMacroMetadata
in interface MacroMetadataSource
getMacroMetadata
in interface MacroModuleDescriptor
public void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
setI18NBeanFactory
in interface UserLocaleAware
i18NBeanFactory
- the user locale sensitive i18n bean factorypublic Macro.BodyType getBodyType()
body-type
attribute value ("PLAIN_TEXT"
,
"RICH_TEXT"
or "NONE"
- indicates the macro really has no body after all) in the <macro>
definition in the atlassian_plugin.xml
.public boolean hasBody()
Macro.hasBody()
without
initialising the module (or macro).
This result of this method is currently required _before_ all plugin modules are parsed and registered (including other plugin modules that may declare spring components).
As such, initialising modules when the spring context is not fully initialized will result in invalid plugins being registered.
In other words we don't want to break lazy initialization of plugin modules and re-introduce problems like CONF-13386.
This is only a best effort attempt. If there is any error constructing the macro using one of its constructors or an error executing hasBody(), then the value is considered false. This should only happen to small percentage of macros.
Macro.hasBody()
Copyright © 2003–2017 Atlassian. All rights reserved.