Class ParentModuleMacro

  • All Implemented Interfaces:
    org.apache.maven.doxia.logging.LogEnabled, org.apache.maven.doxia.macro.Macro

    @Component(role=org.apache.maven.doxia.macro.Macro.class,
               hint="parent-module")
    public class ParentModuleMacro
    extends org.apache.maven.doxia.macro.AbstractMacro
    A macro that inserts a link to the parent module.
    • Method Detail

      • execute

        public void execute​(org.apache.maven.doxia.sink.Sink sink,
                            org.apache.maven.doxia.macro.MacroRequest request)
                     throws org.apache.maven.doxia.macro.MacroExecutionException
        Throws:
        org.apache.maven.doxia.macro.MacroExecutionException
      • createParentModuleParagraph

        private static void createParentModuleParagraph​(org.apache.maven.doxia.module.xdoc.XdocSink sink,
                                                        Class<?> clss,
                                                        String moduleName)
                                                 throws org.apache.maven.doxia.macro.MacroExecutionException
        Creates a paragraph with a link to the parent module.
        Parameters:
        sink - the sink to write to.
        clss - the class of the module.
        moduleName - the module name.
        Throws:
        org.apache.maven.doxia.macro.MacroExecutionException - if the parent module cannot be found.
      • getLinkToParentModule

        private static String getLinkToParentModule​(String parentModule,
                                                    String moduleName)
                                             throws org.apache.maven.doxia.macro.MacroExecutionException
        Returns relative link to the parent module for the given module class.
        Parameters:
        parentModule - parent module name.
        moduleName - the module name we are looking for the parent of.
        Returns:
        relative link to the parent module.
        Throws:
        org.apache.maven.doxia.macro.MacroExecutionException - if link to the parent module cannot be constructed.