Class 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$
    • Field Summary

      • Fields inherited from class org.xwiki.rendering.macro.AbstractMacro

        beanManager, DEFAULT_CATEGORY_CONTENT, DEFAULT_CATEGORY_DEPRECATED, DEFAULT_CATEGORY_DEVELOPMENT, DEFAULT_CATEGORY_FORMATTING, DEFAULT_CATEGORY_INTERNAL, DEFAULT_CATEGORY_LAYOUT, DEFAULT_CATEGORY_NAVIGATION
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractProMacro​(String name, String description, Class<?> parametersBeanClass)
      Creates a new macro instance.
      protected AbstractProMacro​(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.WikiDescriptorManager getWikiDescriptorManager()  
      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
      • Methods inherited from interface org.xwiki.rendering.macro.Macro

        supportsInlineMode
    • 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.
      • AbstractProMacro

        protected AbstractProMacro​(String name,
                                   String description,
                                   Class<?> parametersBeanClass)
        Creates a new macro instance.
        Parameters:
        name - the name of the macro.
        description - the description 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 the Macro implementation
        content - the content of the macro
        context - 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