Class ViolationMessagesMacro
java.lang.Object
org.apache.maven.doxia.macro.AbstractMacro
com.puppycrawl.tools.checkstyle.site.ViolationMessagesMacro
- 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="violation-messages")
public class ViolationMessagesMacro
extends org.apache.maven.doxia.macro.AbstractMacro
A macro that inserts a list of the violation messages.
-
Field Summary
Fields inherited from interface org.apache.maven.doxia.macro.Macro
EOL, ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringconstructMessageKeyUrl(Class<?> clss, String messageKey) Constructs a URL to GitHub that searches for the message key.private static voidcreateListItem(org.apache.maven.doxia.module.xdoc.XdocSink sink, Class<?> clss, String messageKey) Creates a list item for the given field.private static voidcreateListOfMessages(org.apache.maven.doxia.module.xdoc.XdocSink sink, Class<?> clss, Set<String> messageKeys) Iterates through the fields of the class and creates an unordered list.voidexecute(org.apache.maven.doxia.sink.Sink sink, org.apache.maven.doxia.macro.MacroRequest request) Methods inherited from class org.apache.maven.doxia.macro.AbstractMacro
enableLogging, getAttributesFromMap, getLog, required
-
Constructor Details
-
ViolationMessagesMacro
public ViolationMessagesMacro()
-
-
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
-
createListOfMessages
private static void createListOfMessages(org.apache.maven.doxia.module.xdoc.XdocSink sink, Class<?> clss, Set<String> messageKeys) Iterates through the fields of the class and creates an unordered list.- Parameters:
sink- the sink to write to.clss- the class of the fields.messageKeys- the List of message keys to iterate through.
-
createListItem
private static void createListItem(org.apache.maven.doxia.module.xdoc.XdocSink sink, Class<?> clss, String messageKey) Creates a list item for the given field.- Parameters:
sink- the sink to write to.clss- the class of the field.messageKey- the message key.
-
constructMessageKeyUrl
Constructs a URL to GitHub that searches for the message key.- Parameters:
clss- the class of the module.messageKey- the message key.- Returns:
- the URL to GitHub.
-