Class HelpMojo
- java.lang.Object
- 
- org.apache.maven.plugin.AbstractMojo
- 
- org.apache.johnzon.johnzon_maven_plugin.HelpMojo
 
 
- 
- All Implemented Interfaces:
- org.apache.maven.plugin.ContextEnabled,- org.apache.maven.plugin.Mojo
 
 @Mojo(name="help", requiresProject=false, threadSafe=true) public class HelpMojo extends org.apache.maven.plugin.AbstractMojoDisplay help information on johnzon-maven-plugin.
 Callmvn johnzon:help -Ddetail=true -Dgoal=<goal-name>to display parameter details.- Author:
- maven-plugin-tools
 
- 
- 
Field SummaryFields Modifier and Type Field Description private static intDEFAULT_LINE_LENGTHprivate booleandetailIftrue, display all settable properties for each goal.private java.lang.StringgoalThe name of the goal for which to show help.private intindentSizeThe number of spaces per indentation level, should be positive.private intlineLengthThe maximum length of a display line, should be positive.private static java.lang.StringPLUGIN_HELP_PATH
 - 
Constructor SummaryConstructors Constructor Description HelpMojo()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidappend(java.lang.StringBuilder sb, java.lang.String description, int indent)Append a description to the buffer by respecting the indentSize and lineLength parameters.private org.w3c.dom.Documentbuild()voidexecute()private static java.util.List<org.w3c.dom.Node>findNamedChild(org.w3c.dom.Node node, java.lang.String elementName)private static org.w3c.dom.NodefindSingleChild(org.w3c.dom.Node node, java.lang.String elementName)private static intgetIndentLevel(java.lang.String line)Gets the indentation level of the specified line.private static java.lang.StringgetPropertyFromExpression(java.lang.String expression)private static org.w3c.dom.NodegetSingleChild(org.w3c.dom.Node node, java.lang.String elementName)private static java.lang.StringgetValue(org.w3c.dom.Node node, java.lang.String elementName)private static booleanisNotEmpty(java.lang.String string)private static java.lang.Stringrepeat(java.lang.String str, int repeat)Repeat a Stringntimes to form a new string.private static java.util.List<java.lang.String>toLines(java.lang.String text, int indent, int indentSize, int lineLength)Splits the specified text into lines of convenient display length.private static voidtoLines(java.util.List<java.lang.String> lines, java.lang.String line, int indentSize, int lineLength)Adds the specified line to the output sequence, performing line wrapping if necessary.private voidwriteGoal(java.lang.StringBuilder sb, java.lang.String goalPrefix, org.w3c.dom.Element mojo)private voidwriteParameter(java.lang.StringBuilder sb, org.w3c.dom.Node parameter, org.w3c.dom.Node configurationElement)
 
- 
- 
- 
Field Detail- 
detail@Parameter(property="detail", defaultValue="false") private boolean detailIftrue, display all settable properties for each goal.
 - 
goal@Parameter(property="goal") private java.lang.String goal The name of the goal for which to show help. If unspecified, all goals will be displayed.
 - 
lineLength@Parameter(property="lineLength", defaultValue="80") private int lineLengthThe maximum length of a display line, should be positive.
 - 
indentSize@Parameter(property="indentSize", defaultValue="2") private int indentSizeThe number of spaces per indentation level, should be positive.
 - 
PLUGIN_HELP_PATHprivate static final java.lang.String PLUGIN_HELP_PATH - See Also:
- Constant Field Values
 
 - 
DEFAULT_LINE_LENGTHprivate static final int DEFAULT_LINE_LENGTH - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
buildprivate org.w3c.dom.Document build() throws org.apache.maven.plugin.MojoExecutionException- Throws:
- org.apache.maven.plugin.MojoExecutionException
 
 - 
executepublic void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
- org.apache.maven.plugin.MojoExecutionException
 
 - 
isNotEmptyprivate static boolean isNotEmpty(java.lang.String string) 
 - 
getValueprivate static java.lang.String getValue(org.w3c.dom.Node node, java.lang.String elementName) throws org.apache.maven.plugin.MojoExecutionException- Throws:
- org.apache.maven.plugin.MojoExecutionException
 
 - 
getSingleChildprivate static org.w3c.dom.Node getSingleChild(org.w3c.dom.Node node, java.lang.String elementName) throws org.apache.maven.plugin.MojoExecutionException- Throws:
- org.apache.maven.plugin.MojoExecutionException
 
 - 
findNamedChildprivate static java.util.List<org.w3c.dom.Node> findNamedChild(org.w3c.dom.Node node, java.lang.String elementName)
 - 
findSingleChildprivate static org.w3c.dom.Node findSingleChild(org.w3c.dom.Node node, java.lang.String elementName) throws org.apache.maven.plugin.MojoExecutionException- Throws:
- org.apache.maven.plugin.MojoExecutionException
 
 - 
writeGoalprivate void writeGoal(java.lang.StringBuilder sb, java.lang.String goalPrefix, org.w3c.dom.Element mojo) throws org.apache.maven.plugin.MojoExecutionException- Throws:
- org.apache.maven.plugin.MojoExecutionException
 
 - 
writeParameterprivate void writeParameter(java.lang.StringBuilder sb, org.w3c.dom.Node parameter, org.w3c.dom.Node configurationElement) throws org.apache.maven.plugin.MojoExecutionException- Throws:
- org.apache.maven.plugin.MojoExecutionException
 
 - 
repeatprivate static java.lang.String repeat(java.lang.String str, int repeat)Repeat a String ntimes to form a new string.- Parameters:
- str- String to repeat
- repeat- number of times to repeat str
- Returns:
- String with repeated String
- Throws:
- java.lang.NegativeArraySizeException- if- repeat < 0
- java.lang.NullPointerException- if str is- null
 
 - 
appendprivate void append(java.lang.StringBuilder sb, java.lang.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.
 
 - 
toLinesprivate static java.util.List<java.lang.String> toLines(java.lang.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:
- java.lang.NegativeArraySizeException- if- indent < 0
 
 - 
toLinesprivate static void toLines(java.util.List<java.lang.String> lines, java.lang.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.
 
 - 
getIndentLevelprivate static int getIndentLevel(java.lang.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.
 
 - 
getPropertyFromExpressionprivate static java.lang.String getPropertyFromExpression(java.lang.String expression) 
 
- 
 
-