Package com.xwiki.macros
Class AbstractProMacro<P>
- java.lang.Object
-
- org.xwiki.rendering.macro.AbstractMacro<P>
-
- com.xwiki.macros.AbstractProMacro<P>
-
- Type Parameters:
P- the type of the macro parameters bean.
- All Implemented Interfaces:
Comparable<org.xwiki.rendering.macro.Macro<?>>,org.xwiki.component.phase.Initializable,org.xwiki.rendering.macro.Macro<P>
- Direct Known Subclasses:
com.xwiki.macros.showhideif.internal.macro.AbstractShowHideIfMacro
@Unstable public abstract class AbstractProMacro<P> extends org.xwiki.rendering.macro.AbstractMacro<P>Helper to implement a Pro macro.- Since:
- 1.9.1
- Version:
- $Id$
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractProMacro(String name, String description, Class<?> parametersBeanClass)Creates a new macro instance.protectedAbstractProMacro(String name, String description, org.xwiki.rendering.macro.descriptor.ContentDescriptor contentDescriptor, Class<?> parametersBeanClass)Creates a new macro instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<org.xwiki.rendering.block.Block>execute(P parameters, String content, org.xwiki.rendering.transformation.MacroTransformationContext context)Executes the macro.org.xwiki.wiki.descriptor.WikiDescriptorManagergetWikiDescriptorManager()protected abstract List<org.xwiki.rendering.block.Block>internalExecute(P parameters, String content, org.xwiki.rendering.transformation.MacroTransformationContext context)-
Methods inherited from class org.xwiki.rendering.macro.AbstractMacro
compareTo, getDescriptor, getNonGeneratedContentMetaData, getNonGeneratedContentMetaData, getNonGeneratedContentMetaData, getNonGeneratedContentMetaData, getPriority, initialize, setDefaultCategories, setDescriptor, setPriority
-
-
-
-
Constructor Detail
-
AbstractProMacro
protected AbstractProMacro(String name, String description, org.xwiki.rendering.macro.descriptor.ContentDescriptor contentDescriptor, Class<?> parametersBeanClass)
Creates a new macro instance.- Parameters:
name- the name of the macro.description- the description of the macro.contentDescriptor- the content descriptor of the macro.parametersBeanClass- the class of the parameters bean of this class.
-
-
Method Detail
-
execute
public List<org.xwiki.rendering.block.Block> execute(P parameters, String content, org.xwiki.rendering.transformation.MacroTransformationContext context) throws org.xwiki.rendering.macro.MacroExecutionException
Executes the macro.- Parameters:
parameters- the macro parameters in the form of a bean defined by theMacroimplementationcontent- the content of the macrocontext- the context of the macros transformation process- Returns:
- the result of the macro execution as a list of Block elements
- Throws:
org.xwiki.rendering.macro.MacroExecutionException- when an error occurs during the execution process
-
internalExecute
protected abstract List<org.xwiki.rendering.block.Block> internalExecute(P parameters, String content, org.xwiki.rendering.transformation.MacroTransformationContext context) throws org.xwiki.rendering.macro.MacroExecutionException
- Throws:
org.xwiki.rendering.macro.MacroExecutionException
-
getWikiDescriptorManager
public org.xwiki.wiki.descriptor.WikiDescriptorManager getWikiDescriptorManager()
- Returns:
- the wiki descriptor manager
-
-