Class ParentModuleMacro

java.lang.Object
org.apache.maven.doxia.macro.AbstractMacro
com.puppycrawl.tools.checkstyle.site.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
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static void
    createParentModuleParagraph(org.apache.maven.doxia.module.xdoc.XdocSink sink, Class<?> clss, 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 String
    getLinkToParentModule(String parentModule, 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
  • Constructor Details

  • Method Details

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