Interface Macro<P>

  • Type Parameters:
    P - the type of the macro parameters bean
    All Superinterfaces:
    All Known Implementing Classes:
    AbstractMacro, AbstractNoParameterMacro

    public interface Macro<P>
    extends Comparable<Macro<?>>
    Represents a Macro, ie a mechanism to generate Rendering Blocks, that we use as a way to either generate dynamic content or simply as a way to reuse Blocks in content.
    $Id: 6a5f0943063c6139ccc474ebd46ec6184de33560 $
    • Method Detail

      • 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.
        the execution priority
      • getDescriptor

        MacroDescriptor getDescriptor()
        the macro descriptor
      • supportsInlineMode

        boolean supportsInlineMode()
        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 - the macro parameters in the form of a bean defined by the Macro implementation
        content - the content of the macro
        context - the context of the macros transformation process
        the result of the macro execution as a list of Block elements
        MacroExecutionException - error when executing the macro