maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r595945 - /maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
Date Sat, 17 Nov 2007 13:29:16 GMT
Author: vsiveton
Date: Sat Nov 17 05:29:16 2007
New Revision: 595945

URL: http://svn.apache.org/viewvc?rev=595945&view=rev
Log:
MPLUGIN-63: Add since column in the parameters table

o added the since column

Modified:
    maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java

Modified: maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java?rev=595945&r1=595944&r2=595945&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
(original)
+++ maven/plugin-tools/trunk/maven-plugin-tools-api/src/main/java/org/apache/maven/tools/plugin/generator/PluginXdocGenerator.java
Sat Nov 17 05:29:16 2007
@@ -240,9 +240,9 @@
 
         if ( list != null && list.size() > 0 )
         {
-            writeParameterSummary( list, w );
+            writeParameterSummary( mojoDescriptor, list, w );
 
-            writeParameterDetails( list, w );
+            writeParameterDetails( mojoDescriptor, list, w );
         }
     }
 
@@ -271,7 +271,7 @@
         return filtered;
     }
 
-    private void writeParameterDetails( List parameterList, XMLWriter w )
+    private void writeParameterDetails( MojoDescriptor mojoDescriptor, List parameterList,
XMLWriter w )
     {
         w.startElement( "subsection" );
         w.addAttribute( "name", "Parameter Details" );
@@ -294,12 +294,22 @@
             w.endElement(); //p
 
             w.startElement( "ul" );
-            
+
             writeDetail( "Deprecated", parameter.getDeprecated(), w );
 
             writeDetail( "Type", parameter.getType(), w );
 
-            writeDetail( "Since", parameter.getSince(), w );
+            if ( StringUtils.isNotEmpty( parameter.getSince() ) )
+            {
+                writeDetail( "Since", parameter.getSince(), w );
+            }
+            else
+            {
+                if ( StringUtils.isNotEmpty( mojoDescriptor.getSince() ) )
+                {
+                    writeDetail( "Since", mojoDescriptor.getSince(), w );
+                }
+            }
 
             if ( parameter.isRequired() )
             {
@@ -337,22 +347,22 @@
         }
     }
 
-    private void writeParameterSummary( List parameterList, XMLWriter w )
+    private void writeParameterSummary( MojoDescriptor mojoDescriptor, List parameterList,
XMLWriter w )
     {
         List requiredParams = getParametersByRequired( true, parameterList );
         if ( requiredParams.size() > 0 )
         {
-            writeParameterList( "Required Parameters", requiredParams, w );
+            writeParameterList( mojoDescriptor, "Required Parameters", requiredParams, w
);
         }
 
         List optionalParams = getParametersByRequired( false, parameterList );
         if ( optionalParams.size() > 0 )
         {
-            writeParameterList( "Optional Parameters", optionalParams, w );
+            writeParameterList( mojoDescriptor, "Optional Parameters", optionalParams, w
);
         }
     }
 
-    private void writeParameterList( String title, List parameterList, XMLWriter w )
+    private void writeParameterList( MojoDescriptor mojoDescriptor, String title, List parameterList,
XMLWriter w )
     {
         w.startElement( "subsection" );
         w.addAttribute( "name", title );
@@ -367,6 +377,9 @@
         w.writeText( "Type" );
         w.endElement();//th
         w.startElement( "th" );
+        w.writeText( "Since" );
+        w.endElement();//th
+        w.startElement( "th" );
         w.writeText( "Description" );
         w.endElement();//th
         w.endElement();//tr
@@ -382,6 +395,23 @@
             w.startElement( "td" );
             int index = parameter.getType().lastIndexOf( "." );
             w.writeMarkup( "<code>" + parameter.getType().substring( index + 1 ) +
"</code>" );
+            w.endElement();//td
+            w.startElement( "td" );
+            if ( StringUtils.isNotEmpty( parameter.getSince() ) )
+            {
+                w.writeMarkup( "<code>" + parameter.getSince() + "</code>" );
+            }
+            else
+            {
+                if ( StringUtils.isNotEmpty( mojoDescriptor.getSince() ) )
+                {
+                    w.writeMarkup( "<code>" + mojoDescriptor.getSince() + "</code>"
);
+                }
+                else
+                {
+                    w.writeMarkup( "<code>-</code>" );
+                }
+            }
             w.endElement();//td
             w.startElement( "td" );
             String description = parameter.getDescription();



Mime
View raw message