org.xwiki.rendering.macro
Interface Macro<P>
- Type Parameters:
P - the type of the macro parameters bean
- All Superinterfaces:
- Comparable<Macro<?>>
- All Known Implementing Classes:
- AbstractMacro, AbstractNoParameterMacro
@ComponentRole
public interface Macro<P>
- extends Comparable<Macro<?>>
- Since:
- 1.5M2
- Version:
- $Id: dd1d228a37252e423f1457d0d58cda76aea8a507 $
getPriority
int getPriority()
- The priority of execution relative to the other Macros. The lowest values have the highest priorities and execute
first. For example a Macro with a priority of 100 will execute before one with a priority of 500.
- Returns:
- the execution priority
getDescriptor
MacroDescriptor getDescriptor()
- Returns:
- the macro descriptor
supportsInlineMode
boolean supportsInlineMode()
- 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.
execute
List<Block> execute(P parameters,
String content,
MacroTransformationContext context)
throws MacroExecutionException
- Executes the macro.
- Parameters:
parameters - the macro parameters in the form of a bean defined by the Macro implementationcontent - 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:
MacroExecutionException - error when executing the macro
Copyright © 2004-2011 XWiki. All Rights Reserved.