You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by vs...@apache.org on 2008/07/26 15:55:45 UTC

svn commit: r679993 - /maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java

Author: vsiveton
Date: Sat Jul 26 06:55:45 2008
New Revision: 679993

URL: http://svn.apache.org/viewvc?rev=679993&view=rev
Log:
o reduced executeReport() length

Modified:
    maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java?rev=679993&r1=679992&r2=679993&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/main/java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java Sat Jul 26 06:55:45 2008
@@ -1596,26 +1596,7 @@
                                   JavadocUtil.quotedPathArgument( excludedocfilessubdir ), SINCE_JAVADOC_1_4 );
             }
             addArgIfNotEmpty( arguments, "-footer", JavadocUtil.quotedArgument( footer ), false, false );
-            if ( groups != null )
-            {
-                for ( int i = 0; i < groups.length; i++ )
-                {
-                    if ( groups[i] == null || StringUtils.isEmpty( groups[i].getTitle() )
-                        || StringUtils.isEmpty( groups[i].getPackages() ) )
-                    {
-                        if ( getLog().isWarnEnabled() )
-                        {
-                            getLog().warn( "A group option is empty. Ignore this option." );
-                        }
-                    }
-                    else
-                    {
-                        String groupTitle = StringUtils.replace( groups[i].getTitle(), ",", "&#44;" );
-                        addArgIfNotEmpty( arguments, "-group", JavadocUtil.quotedArgument( groupTitle ) + " "
-                            + JavadocUtil.quotedArgument( groups[i].getPackages() ), true );
-                    }
-                }
-            }
+            addGroups( arguments );
             addArgIfNotEmpty( arguments, "-header", JavadocUtil.quotedArgument( header ), false, false );
             addArgIfNotEmpty( arguments, "-helpfile", JavadocUtil.quotedPathArgument( helpfile ) );
             addArgIf( arguments, keywords, "-keywords", SINCE_JAVADOC_1_4_2 );
@@ -1659,56 +1640,11 @@
                               JavadocUtil.quotedPathArgument( getStylesheetFile( javadocOutputDirectory ) ) );
 
             addArgIfNotEmpty( arguments, "-taglet", JavadocUtil.quotedArgument( taglet ), SINCE_JAVADOC_1_4 );
-            if ( taglets != null )
-            {
-                for ( int i = 0; i < taglets.length; i++ )
-                {
-                    if ( ( taglets[i] == null ) || ( StringUtils.isEmpty( taglets[i].getTagletClass() ) ) )
-                    {
-                        if ( getLog().isWarnEnabled() )
-                        {
-                            getLog().warn( "A taglet option is empty. Ignore this option." );
-                        }
-                    }
-                    else
-                    {
-                        addArgIfNotEmpty( arguments, "-taglet",
-                                          JavadocUtil.quotedArgument( taglets[i].getTagletClass() ),
-                                          SINCE_JAVADOC_1_4 );
-                    }
-                }
-            }
+            addTaglets( arguments );
             addTagletsFromTagletArtifacts( arguments );
             addArgIfNotEmpty( arguments, "-tagletpath", JavadocUtil.quotedPathArgument( getTagletPath() ),
                               SINCE_JAVADOC_1_4 );
-
-            if ( tags != null )
-            {
-                for ( int i = 0; i < tags.length; i++ )
-                {
-                    if ( StringUtils.isEmpty( tags[i].getName() ) )
-                    {
-                        if ( getLog().isWarnEnabled() )
-                        {
-                            getLog().warn( "A tag name is empty. Ignore this option." );
-                        }
-                    }
-                    else
-                    {
-                        String value = "\"" + tags[i].getName();
-                        if ( StringUtils.isNotEmpty( tags[i].getPlacement() ) )
-                        {
-                            value += ":" + tags[i].getPlacement();
-                            if ( StringUtils.isNotEmpty( tags[i].getHead() ) )
-                            {
-                                value += ":" + tags[i].getHead();
-                            }
-                        }
-                        value += "\"";
-                        addArgIfNotEmpty( arguments, "-tag", value, SINCE_JAVADOC_1_4 );
-                    }
-                }
-            }
+            addTags( arguments );
 
             addArgIfNotEmpty( arguments, "-top", JavadocUtil.quotedArgument( top ), false, false,
                               SINCE_JAVADOC_1_6 );
@@ -3602,6 +3538,105 @@
     }
 
     /**
+     * Add <code>groups</code> parameter to arguments.
+     *
+     * @param arguments not null
+     */
+    private void addGroups( List arguments )
+    {
+        if ( groups == null )
+        {
+            return;
+
+        }
+
+        for ( int i = 0; i < groups.length; i++ )
+        {
+            if ( groups[i] == null || StringUtils.isEmpty( groups[i].getTitle() )
+                || StringUtils.isEmpty( groups[i].getPackages() ) )
+            {
+                if ( getLog().isWarnEnabled() )
+                {
+                    getLog().warn( "A group option is empty. Ignore this option." );
+                }
+            }
+            else
+            {
+                String groupTitle = StringUtils.replace( groups[i].getTitle(), ",", "&#44;" );
+                addArgIfNotEmpty( arguments, "-group", JavadocUtil.quotedArgument( groupTitle ) + " "
+                    + JavadocUtil.quotedArgument( groups[i].getPackages() ), true );
+            }
+        }
+    }
+
+    /**
+     * Add <code>tags</code> parameter to arguments.
+     *
+     * @param arguments not null
+     */
+    private void addTags( List arguments )
+    {
+        if ( tags == null )
+        {
+            return;
+        }
+
+        for ( int i = 0; i < tags.length; i++ )
+        {
+            if ( StringUtils.isEmpty( tags[i].getName() ) )
+            {
+                if ( getLog().isWarnEnabled() )
+                {
+                    getLog().warn( "A tag name is empty. Ignore this option." );
+                }
+            }
+            else
+            {
+                String value = "\"" + tags[i].getName();
+                if ( StringUtils.isNotEmpty( tags[i].getPlacement() ) )
+                {
+                    value += ":" + tags[i].getPlacement();
+                    if ( StringUtils.isNotEmpty( tags[i].getHead() ) )
+                    {
+                        value += ":" + tags[i].getHead();
+                    }
+                }
+                value += "\"";
+                addArgIfNotEmpty( arguments, "-tag", value, SINCE_JAVADOC_1_4 );
+            }
+        }
+    }
+
+    /**
+     * Add <code>taglets</code> parameter to arguments.
+     *
+     * @param arguments not null
+     */
+    private void addTaglets( List arguments )
+    {
+        if ( taglets == null )
+        {
+            return;
+        }
+
+        for ( int i = 0; i < taglets.length; i++ )
+        {
+            if ( ( taglets[i] == null ) || ( StringUtils.isEmpty( taglets[i].getTagletClass() ) ) )
+            {
+                if ( getLog().isWarnEnabled() )
+                {
+                    getLog().warn( "A taglet option is empty. Ignore this option." );
+                }
+            }
+            else
+            {
+                addArgIfNotEmpty( arguments, "-taglet", JavadocUtil.quotedArgument( taglets[i].getTagletClass() ),
+                                  SINCE_JAVADOC_1_4 );
+            }
+        }
+    }
+
+    /**
      * Auto-detect taglets class name from <code>tagletArtifacts</code> and add them to arguments.
      *
      * @param arguments not null