Class PluginXdocGenerator
- java.lang.Object
-
- org.apache.maven.tools.plugin.generator.PluginXdocGenerator
-
-
Constructor Summary
Constructors Constructor Description PluginXdocGenerator()Default constructor usingLocale.ENGLISHas locale.PluginXdocGenerator(org.apache.maven.project.MavenProject project)Constructor usingLocale.ENGLISHas locale.PluginXdocGenerator(org.apache.maven.project.MavenProject project, java.util.Locale locale)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleanaddUl(org.codehaus.plexus.util.xml.XMLWriter w, boolean addedUl)private booleanaddUl(org.codehaus.plexus.util.xml.XMLWriter w, boolean addedUl, java.lang.String content)private java.lang.StringescapeXml(java.lang.String text)voidexecute(java.io.File destinationDirectory, PluginToolsRequest request)Execute the generation for a given plugin descriptor.private java.util.List<org.apache.maven.plugin.descriptor.Parameter>filterParameters(java.util.List<org.apache.maven.plugin.descriptor.Parameter> parameterList)Filter parameters to only retain those which must be documented, ie not components nor readonly.private java.lang.Stringformat(java.lang.String key, java.lang.Object arg1)Convenience method.private java.lang.Stringformat(java.lang.String key, java.lang.Object[] args)Looks up the value forkeyin theResourceBundle, then formats that value for the specifiedLocaleusingargs.private java.util.ResourceBundlegetBundle()Gets the resource bundle for thelocaleinstance variable.private java.lang.StringgetMojoFilename(org.apache.maven.plugin.descriptor.MojoDescriptor mojo, java.lang.String ext)private java.util.List<org.apache.maven.plugin.descriptor.Parameter>getParametersByRequired(boolean required, java.util.List<org.apache.maven.plugin.descriptor.Parameter> parameterList)private java.lang.StringgetPropertyFromExpression(java.lang.String expression)private java.lang.StringgetString(java.lang.String key)protected voidprocessMojoDescriptor(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, java.io.File destinationDirectory)private voidwriteBody(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, org.codehaus.plexus.util.xml.XMLWriter w)private voidwriteDetail(java.lang.String param, java.lang.String value, org.codehaus.plexus.util.xml.XMLWriter w)private voidwriteGoalAttributes(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, org.codehaus.plexus.util.xml.XMLWriter w)private voidwriteGoalParameterTable(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, org.codehaus.plexus.util.xml.XMLWriter w)private voidwriteParameterDetails(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, java.util.List<org.apache.maven.plugin.descriptor.Parameter> parameterList, org.codehaus.plexus.util.xml.XMLWriter w)private voidwriteParameterList(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, java.lang.String title, java.util.List<org.apache.maven.plugin.descriptor.Parameter> parameterList, org.codehaus.plexus.util.xml.XMLWriter w)private voidwriteParameterSummary(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, java.util.List<org.apache.maven.plugin.descriptor.Parameter> parameterList, org.codehaus.plexus.util.xml.XMLWriter w)private voidwriteReportNotice(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, org.codehaus.plexus.util.xml.XMLWriter w)
-
-
-
Constructor Detail
-
PluginXdocGenerator
public PluginXdocGenerator()
Default constructor usingLocale.ENGLISHas locale. Used only in test cases.
-
PluginXdocGenerator
public PluginXdocGenerator(org.apache.maven.project.MavenProject project)
Constructor usingLocale.ENGLISHas locale.- Parameters:
project- not null Maven project.
-
PluginXdocGenerator
public PluginXdocGenerator(org.apache.maven.project.MavenProject project, java.util.Locale locale)- Parameters:
project- not null.locale- not null wanted locale.
-
-
Method Detail
-
execute
public void execute(java.io.File destinationDirectory, PluginToolsRequest request) throws GeneratorExceptionExecute the generation for a given plugin descriptor.- Specified by:
executein interfaceGenerator- Parameters:
destinationDirectory- requiredrequest- required- Throws:
GeneratorException- if any
-
processMojoDescriptor
protected void processMojoDescriptor(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, java.io.File destinationDirectory) throws java.io.IOException- Parameters:
mojoDescriptor- not nulldestinationDirectory- not null- Throws:
java.io.IOException- if any
-
getMojoFilename
private java.lang.String getMojoFilename(org.apache.maven.plugin.descriptor.MojoDescriptor mojo, java.lang.String ext)- Parameters:
mojo- not nullext- not null- Returns:
- the output file name
-
writeBody
private void writeBody(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, org.codehaus.plexus.util.xml.XMLWriter w)- Parameters:
mojoDescriptor- not nullw- not null
-
writeReportNotice
private void writeReportNotice(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, org.codehaus.plexus.util.xml.XMLWriter w)- Parameters:
mojoDescriptor- not nullw- not null
-
writeGoalAttributes
private void writeGoalAttributes(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, org.codehaus.plexus.util.xml.XMLWriter w)- Parameters:
mojoDescriptor- not nullw- not null
-
writeGoalParameterTable
private void writeGoalParameterTable(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, org.codehaus.plexus.util.xml.XMLWriter w)- Parameters:
mojoDescriptor- not nullw- not null
-
filterParameters
private java.util.List<org.apache.maven.plugin.descriptor.Parameter> filterParameters(java.util.List<org.apache.maven.plugin.descriptor.Parameter> parameterList)
Filter parameters to only retain those which must be documented, ie not components nor readonly.- Parameters:
parameterList- not null- Returns:
- the parameters list without components.
-
writeParameterDetails
private void writeParameterDetails(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, java.util.List<org.apache.maven.plugin.descriptor.Parameter> parameterList, org.codehaus.plexus.util.xml.XMLWriter w)- Parameters:
mojoDescriptor- not nullparameterList- not nullw- not null
-
addUl
private boolean addUl(org.codehaus.plexus.util.xml.XMLWriter w, boolean addedUl, java.lang.String content)
-
addUl
private boolean addUl(org.codehaus.plexus.util.xml.XMLWriter w, boolean addedUl)
-
getPropertyFromExpression
private java.lang.String getPropertyFromExpression(java.lang.String expression)
-
writeDetail
private void writeDetail(java.lang.String param, java.lang.String value, org.codehaus.plexus.util.xml.XMLWriter w)- Parameters:
param- not nullvalue- could be nullw- not null
-
writeParameterSummary
private void writeParameterSummary(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, java.util.List<org.apache.maven.plugin.descriptor.Parameter> parameterList, org.codehaus.plexus.util.xml.XMLWriter w)- Parameters:
mojoDescriptor- not nullparameterList- not nullw- not null
-
writeParameterList
private void writeParameterList(org.apache.maven.plugin.descriptor.MojoDescriptor mojoDescriptor, java.lang.String title, java.util.List<org.apache.maven.plugin.descriptor.Parameter> parameterList, org.codehaus.plexus.util.xml.XMLWriter w)- Parameters:
mojoDescriptor- not nulltitle- not nullparameterList- not nullw- not null
-
getParametersByRequired
private java.util.List<org.apache.maven.plugin.descriptor.Parameter> getParametersByRequired(boolean required, java.util.List<org.apache.maven.plugin.descriptor.Parameter> parameterList)- Parameters:
required-truefor required parameters,falseotherwise.parameterList- not null- Returns:
- list of parameters depending the value of
required
-
getBundle
private java.util.ResourceBundle getBundle()
Gets the resource bundle for thelocaleinstance variable.- Returns:
- The resource bundle for the
localeinstance variable.
-
getString
private java.lang.String getString(java.lang.String key)
- Parameters:
key- not null- Returns:
- Localized, text identified by
key. - See Also:
getBundle()
-
format
private java.lang.String format(java.lang.String key, java.lang.Object arg1)Convenience method.- Parameters:
key- not nullarg1- not null- Returns:
- Localized, formatted text identified by
key. - See Also:
format(String, Object[])
-
format
private java.lang.String format(java.lang.String key, java.lang.Object[] args)Looks up the value forkeyin theResourceBundle, then formats that value for the specifiedLocaleusingargs.- Parameters:
key- not nullargs- not null- Returns:
- Localized, formatted text identified by
key.
-
escapeXml
private java.lang.String escapeXml(java.lang.String text)
- Parameters:
text- the string to escape- Returns:
- A string escaped with XML entities
-
-