Class AbstractMacroDescriptor

    • Constructor Detail

      • AbstractMacroDescriptor

        public AbstractMacroDescriptor​(MacroId id,
                                       String name,
                                       String description,
                                       ContentDescriptor contentDescriptor,
                                       org.xwiki.properties.BeanDescriptor parametersBeanDescriptor)
        Parameters:
        id - the id of the macro
        name - 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

      • getName

        public String getName()
        Specified by:
        getName in interface MacroDescriptor
        Returns:
        the human-readable name of the macro (eg "Table Of Contents" for the TOC macro).
        Since:
        2.0M3
      • 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: MacroDescriptor
        A 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:
        getDefaultCategories in interface MacroDescriptor
        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:
        supportsInlineMode in interface MacroDescriptor
        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 - true to support in-line mode, false otherwise
        Since:
        10.10RC1
        See Also:
        supportsInlineMode()