public abstract class AbstractMacroDescriptor extends Object implements MacroDescriptor
Constructor and Description |
---|
AbstractMacroDescriptor(MacroId id,
String name,
String description,
ContentDescriptor contentDescriptor,
org.xwiki.properties.BeanDescriptor parametersBeanDescriptor) |
AbstractMacroDescriptor(String name,
String description,
ContentDescriptor contentDescriptor,
org.xwiki.properties.BeanDescriptor parametersBeanDescriptor)
Deprecated.
since 2.3M1 use
AbstractMacroDescriptor(MacroId, String, String, ContentDescriptor, BeanDescriptor) instead |
Modifier and Type | Method and Description |
---|---|
protected void |
extractParameterDescriptorMap()
Extract parameters informations from
parametersBeanDescriptor and insert it in
parameterDescriptorMap . |
ContentDescriptor |
getContentDescriptor() |
String |
getDefaultCategory()
A macro can define a default classification category under which it falls.
|
String |
getDescription() |
MacroId |
getId() |
String |
getName() |
Map<String,ParameterDescriptor> |
getParameterDescriptorMap()
Get all the parameters descriptors.
|
Class<?> |
getParametersBeanClass() |
void |
setDefaultCategory(String defaultCategory) |
void |
setSupportsInlineMode(boolean supportsInlineMode) |
boolean |
supportsInlineMode() |
public AbstractMacroDescriptor(MacroId id, String name, String description, ContentDescriptor contentDescriptor, org.xwiki.properties.BeanDescriptor parametersBeanDescriptor)
id
- the id of the macroname
- the name of the macro (eg "Table Of Contents" for the TOC macro)description
- the description of the macro.contentDescriptor
- the description of the macro content. null indicate macro does not support content.parametersBeanDescriptor
- the description of the parameters bean or null if there are no parameters for
this macro.@Deprecated public AbstractMacroDescriptor(String name, String description, ContentDescriptor contentDescriptor, org.xwiki.properties.BeanDescriptor parametersBeanDescriptor)
AbstractMacroDescriptor(MacroId, String, String, ContentDescriptor, BeanDescriptor)
insteadname
- the name of the macro (eg "Table Of Contents" for the TOC macro)description
- the description of the macro.contentDescriptor
- the description of the macro content. null indicate macro does not support content.parametersBeanDescriptor
- the description of the parameters bean or null if there are no parameters for
this macro.protected void extractParameterDescriptorMap()
parametersBeanDescriptor
and insert it in
parameterDescriptorMap
.public MacroId getId()
getId
in interface MacroDescriptor
public String getName()
getName
in interface MacroDescriptor
public ContentDescriptor getContentDescriptor()
getContentDescriptor
in interface MacroDescriptor
public String getDescription()
getDescription
in interface MacroDescriptor
public Class<?> getParametersBeanClass()
getParametersBeanClass
in interface MacroDescriptor
public Map<String,ParameterDescriptor> getParameterDescriptorMap()
MacroDescriptor
The Map
key is lower case. ParameterDescriptor.getId()
can be used to access the source parameter
identifier (with the source case).
getParameterDescriptorMap
in interface MacroDescriptor
Map
containing the ParameterDescriptor
for each parameter (the keys are lower cased).public String getDefaultCategory()
MacroDescriptor
getDefaultCategory
in interface MacroDescriptor
public void setDefaultCategory(String defaultCategory)
defaultCategory
- default category under which this macro should be listed.MacroDescriptor.getDefaultCategory()
public boolean supportsInlineMode()
supportsInlineMode
in interface MacroDescriptor
== hello {{velocity}}world{{/velocity}}
then the Velocity macro must
support the inline mode and not generate a paragraph.public void setSupportsInlineMode(boolean supportsInlineMode)
supportsInlineMode
- true
to support in-line mode, false
otherwisesupportsInlineMode()
Copyright © 2004–2022 XWiki. All rights reserved.