Class AbstractMacroDescriptor
- java.lang.Object
-
- org.xwiki.rendering.macro.descriptor.AbstractMacroDescriptor
-
- All Implemented Interfaces:
MacroDescriptor
- Direct Known Subclasses:
DefaultMacroDescriptor
public abstract class AbstractMacroDescriptor extends Object implements MacroDescriptor
Describe a macro.- Since:
- 1.6M1
- Version:
- $Id: f3157f69a9908a0e9c34f154ddb9513eb6bbcc68 $
-
-
Constructor Summary
Constructors Constructor Description AbstractMacroDescriptor(MacroId id, String name, String description, ContentDescriptor contentDescriptor, org.xwiki.properties.BeanDescriptor parametersBeanDescriptor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidextractParameterDescriptorMap()Extract parameters informations fromparametersBeanDescriptorand insert it inparameterDescriptorMap.ContentDescriptorgetContentDescriptor()Set<String>getDefaultCategories()A macro defines a set of classification categories under which it falls.StringgetDescription()MacroIdgetId()StringgetName()Map<String,ParameterDescriptor>getParameterDescriptorMap()Get all the parameters descriptors.Class<?>getParametersBeanClass()voidsetDefaultCategories(Set<String> defaultCategories)voidsetSupportsInlineMode(boolean supportsInlineMode)booleansupportsInlineMode()
-
-
-
Constructor Detail
-
AbstractMacroDescriptor
public AbstractMacroDescriptor(MacroId id, String name, String description, ContentDescriptor contentDescriptor, org.xwiki.properties.BeanDescriptor parametersBeanDescriptor)
- Parameters:
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.- Since:
- 2.3M1
-
-
Method Detail
-
extractParameterDescriptorMap
protected void extractParameterDescriptorMap()
Extract parameters informations fromparametersBeanDescriptorand insert it inparameterDescriptorMap.- Since:
- 1.7M2
-
getId
public MacroId getId()
- Specified by:
getIdin interfaceMacroDescriptor- Returns:
- the id of the macro
- Since:
- 2.3M1
-
getName
public String getName()
- Specified by:
getNamein interfaceMacroDescriptor- Returns:
- the human-readable name of the macro (eg "Table Of Contents" for the TOC macro).
- Since:
- 2.0M3
-
getContentDescriptor
public ContentDescriptor getContentDescriptor()
- Specified by:
getContentDescriptorin interfaceMacroDescriptor- Returns:
- describe the macro content. If null the macro does not support content.
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceMacroDescriptor- Returns:
- the description of the macro.
-
getParametersBeanClass
public Class<?> getParametersBeanClass()
- Specified by:
getParametersBeanClassin interfaceMacroDescriptor- Returns:
- the class of the JAVA bean containing macro parameters.
-
getParameterDescriptorMap
public Map<String,ParameterDescriptor> getParameterDescriptorMap()
Description copied from interface:MacroDescriptorGet all the parameters descriptors.The
Mapkey is lower case.ParameterDescriptor.getId()can be used to access the source parameter identifier (with the source case).- Specified by:
getParameterDescriptorMapin interfaceMacroDescriptor- Returns:
- a
Mapcontaining theParameterDescriptorfor each parameter (the keys are lower cased).
-
setDefaultCategories
@Unstable public void setDefaultCategories(Set<String> defaultCategories)
- Parameters:
defaultCategories- the list of default categories which the macro should be listed- Since:
- 14.6RC1
- See Also:
MacroDescriptor.getDefaultCategories()
-
getDefaultCategories
public Set<String> getDefaultCategories()
Description copied from interface:MacroDescriptorA macro defines a set of classification categories under which it falls. For instance, the "skype" macro would fall under the "Communication" and "Video" categories. However, a wiki administrator has the ability to override the default categories for a given macro in order to organize categories as he or she sees fit. Thus, these default categories are only an indication from the macro author about what categories the macro should fall.- Specified by:
getDefaultCategoriesin interfaceMacroDescriptor- Returns:
- the default categories under which this macro should be listed, or the empty list of the macro does not have any default category defined
-
supportsInlineMode
public boolean supportsInlineMode()
- Specified by:
supportsInlineModein interfaceMacroDescriptor- Returns:
- true if the macro can be inserted in some existing content such as a paragraph, a list item etc. For
example if I have
== hello {{velocity}}world{{/velocity}}then the Velocity macro must support the inline mode and not generate a paragraph.
-
setSupportsInlineMode
public void setSupportsInlineMode(boolean supportsInlineMode)
- Parameters:
supportsInlineMode-trueto support in-line mode,falseotherwise- Since:
- 10.10RC1
- See Also:
supportsInlineMode()
-
-