Class 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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.String constructMessageKeyUrl​(java.lang.Class<?> clss, java.lang.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, java.lang.Class<?> clss, java.lang.String messageKey)
      Creates a list item for the given field.
      private static void createListOfMessages​(org.apache.maven.doxia.module.xdoc.XdocSink sink, java.lang.Class<?> clss, java.util.Set<java.lang.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
    • 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
      • createListOfMessages

        private static void createListOfMessages​(org.apache.maven.doxia.module.xdoc.XdocSink sink,
                                                 java.lang.Class<?> clss,
                                                 java.util.Set<java.lang.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,
                                           java.lang.Class<?> clss,
                                           java.lang.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 java.lang.String constructMessageKeyUrl​(java.lang.Class<?> clss,
                                                               java.lang.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.