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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private static String
    constructMessageKeyUrl(Class<?> clss, String messageKey)
    Constructs a URL to GitHub that searches for the message key.
    private static void
    createListItem(org.apache.maven.doxia.module.xdoc.XdocSink sink, Class<?> clss, String messageKey)
    Creates a list item for the given field.
    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.
    void
    execute(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

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

      private static String constructMessageKeyUrl(Class<?> clss, String messageKey)
      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.