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