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.
    • Field Summary

      • Fields inherited from interface org.apache.maven.doxia.macro.Macro

        EOL, ROLE
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static void createParentModuleParagraph​(org.apache.maven.doxia.module.xdoc.XdocSink sink, java.lang.Class<?> clss, java.lang.String moduleName)
      Creates a paragraph with a link to the parent module.
      void execute​(org.apache.maven.doxia.sink.Sink sink, org.apache.maven.doxia.macro.MacroRequest request)  
      private static java.lang.String getLinkToParentModule​(java.lang.String parentModule, java.lang.String moduleName)
      Returns relative link to the parent module for the given module class.
      • Methods inherited from class org.apache.maven.doxia.macro.AbstractMacro

        enableLogging, getAttributesFromMap, getLog, required
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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,
                                                        java.lang.Class<?> clss,
                                                        java.lang.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 java.lang.String getLinkToParentModule​(java.lang.String parentModule,
                                                              java.lang.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.