Class HelpMojo

  • All Implemented Interfaces:
    ContextEnabled, Mojo

    @Mojo(name="help",
          requiresProject=false,
          threadSafe=true)
    public class HelpMojo
    extends AbstractMojo
    Display help information on hibernate62-ddl-maven-plugin.
    Call mvn hibernate62-ddl:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
    Author:
    maven-plugin-tools
    • Constructor Detail

      • HelpMojo

        public HelpMojo()
    • Method Detail

      • isNotEmpty

        private static boolean isNotEmpty​(String string)
      • findNamedChild

        private static List<Node> findNamedChild​(Node node,
                                                 String elementName)
      • repeat

        private static String repeat​(String str,
                                     int repeat)

        Repeat a String n times to form a new string.

        Parameters:
        str - String to repeat
        repeat - number of times to repeat str
        Returns:
        String with repeated String
        Throws:
        NegativeArraySizeException - if repeat < 0
        NullPointerException - if str is null
      • append

        private void append​(StringBuilder sb,
                            String description,
                            int indent)
        Append a description to the buffer by respecting the indentSize and lineLength parameters. Note: The last character is always a new line.
        Parameters:
        sb - The buffer to append the description, not null.
        description - The description, not null.
        indent - The base indentation level of each line, must not be negative.
      • toLines

        private static List<String> toLines​(String text,
                                            int indent,
                                            int indentSize,
                                            int lineLength)
        Splits the specified text into lines of convenient display length.
        Parameters:
        text - The text to split into lines, must not be null.
        indent - The base indentation level of each line, must not be negative.
        indentSize - The size of each indentation, must not be negative.
        lineLength - The length of the line, must not be negative.
        Returns:
        The sequence of display lines, never null.
        Throws:
        NegativeArraySizeException - if indent < 0
      • toLines

        private static void toLines​(List<String> lines,
                                    String line,
                                    int indentSize,
                                    int lineLength)
        Adds the specified line to the output sequence, performing line wrapping if necessary.
        Parameters:
        lines - The sequence of display lines, must not be null.
        line - The line to add, must not be null.
        indentSize - The size of each indentation, must not be negative.
        lineLength - The length of the line, must not be negative.
      • getIndentLevel

        private static int getIndentLevel​(String line)
        Gets the indentation level of the specified line.
        Parameters:
        line - The line whose indentation level should be retrieved, must not be null.
        Returns:
        The indentation level of the line.
      • getPropertyFromExpression

        private static String getPropertyFromExpression​(String expression)