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.
-
-
Constructor Summary
Constructors Constructor Description ParentModuleMacro()
-
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, 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.
-
-
-
Constructor Detail
-
ParentModuleMacro
public ParentModuleMacro()
-
-
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.
-
-