maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r581889 - in /maven/plugins/trunk/maven-javadoc-plugin/src/main: java/org/apache/maven/plugin/javadoc/AbstractJavadocMojo.java java/org/apache/maven/plugin/javadoc/OfflineLink.java mdo/javadocOptions.mdo
Date Thu, 04 Oct 2007 13:12:19 GMT
Author: vsiveton
Date: Thu Oct  4 06:12:18 2007
New Revision: 581889

URL: http://svn.apache.org/viewvc?rev=581889&view=rev
Log:
MJAVADOC-153: Generate the OfflineLink class with Modello

o replaced OfflineLink class by a Modello generated class

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

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=581889&r1=581888&r2=581889&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
Thu Oct  4 06:12:18 2007
@@ -57,6 +57,7 @@
 import org.apache.maven.plugin.javadoc.options.Group;
 import org.apache.maven.plugin.javadoc.options.DocletArtifact;
 import org.apache.maven.plugin.javadoc.options.JavadocPathArtifact;
+import org.apache.maven.plugin.javadoc.options.OfflineLink;
 import org.apache.maven.plugin.javadoc.options.Tag;
 import org.apache.maven.plugin.javadoc.options.Taglet;
 import org.apache.maven.plugin.javadoc.options.TagletArtifact;
@@ -662,10 +663,20 @@
      * referenced classes.
      * <br/>
      * See <a href="http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javadoc.html#linkoffline">linkoffline</a>.
+     * <br/>
+     * Example:
+     * <pre>
+     * &lt;offlineLinks&gt;<br/>
+     *   &lt;offlineLink&gt;<br/>
+     *     &lt;url&gt;http://java.sun.com/j2se/1.5.0/docs/api/&lt;/url&gt;<br/>
+     *     &lt;location&gt;../javadoc/jdk-5.0/&lt;/location&gt;<br/>
+     *   &lt;/offlineLink&gt;<br/>
+     *  &lt;/offlineLinks&gt;
+     * </pre>
      *
      * @parameter expression="${offlineLinks}"
      */
-    private ArrayList offlineLinks;
+    private OfflineLink[] offlineLinks;
 
     /**
      * Creates an HTML version of each source file (with line numbers) and adds links to
them from the standard
@@ -2315,6 +2326,8 @@
      */
     private void addLinkofflineArguments( List arguments )
     {
+        List offlineLinksList = ( offlineLinks != null ? Arrays.asList( offlineLinks ) :
new ArrayList() );
+
         if ( !aggregate && reactorProjects != null )
         {
             String javadocDirRelative = PathUtils.toRelative( project.getBasedir(), getOutputDirectory()
);
@@ -2331,24 +2344,19 @@
 
                 if ( p.getUrl() != null )
                 {
-                    if ( offlineLinks == null )
-                    {
-                        offlineLinks = new ArrayList();
-                    }
-
                     OfflineLink ol = new OfflineLink();
                     ol.setUrl( p.getUrl() + "/apidocs" );
                     ol.setLocation( p.getBasedir().getAbsolutePath() + "/" + javadocDirRelative
);
-                    offlineLinks.add( ol );
+                    offlineLinksList.add( ol );
                 }
             }
         }
 
-        if ( offlineLinks != null )
+        if ( offlineLinksList != null )
         {
-            for ( int i = 0; i < offlineLinks.size(); i++ )
+            for ( int i = 0; i < offlineLinksList.size(); i++ )
             {
-                OfflineLink offlineLink = (OfflineLink) offlineLinks.get( i );
+                OfflineLink offlineLink = (OfflineLink) offlineLinksList.get( i );
                 addArgIfNotEmpty( arguments, "-linkoffline", quotedPathArgument( offlineLink.getUrl()
) + " "
                     + quotedPathArgument( offlineLink.getLocation() ), true );
             }

Modified: maven/plugins/trunk/maven-javadoc-plugin/src/main/mdo/javadocOptions.mdo
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-javadoc-plugin/src/main/mdo/javadocOptions.mdo?rev=581889&r1=581888&r2=581889&view=diff
==============================================================================
--- maven/plugins/trunk/maven-javadoc-plugin/src/main/mdo/javadocOptions.mdo (original)
+++ maven/plugins/trunk/maven-javadoc-plugin/src/main/mdo/javadocOptions.mdo Thu Oct  4 06:12:18
2007
@@ -165,12 +165,14 @@
 
     <class>
       <name>DocletArtifact</name>
+      <description>A doclet parameter as artifact.</description>
       <version>1.0.0</version>
       <superClass>JavadocPathArtifact</superClass>
     </class>
 
     <class>
       <name>TagletArtifact</name>
+      <description>A taglet parameter as artifact.</description>
       <version>1.0.0</version>
       <superClass>JavadocPathArtifact</superClass>
     </class>
@@ -201,6 +203,28 @@
           <association>
             <type>TagletArtifact</type>
           </association>
+        </field>
+      </fields>
+    </class>
+
+    <class>
+      <name>OfflineLink</name>
+      <description>An offline link parameter.</description>
+      <version>1.0.0</version>
+      <fields>
+        <field>
+          <name>url</name>
+          <description>The url of the link.</description>
+          <version>1.0.0</version>
+          <type>String</type>
+          <identifier>true</identifier>
+        </field>
+        <field>
+          <name>location</name>
+          <description>The location of the link.</description>
+          <version>1.0.0</version>
+          <type>String</type>
+          <identifier>true</identifier>
         </field>
       </fields>
     </class>



Mime
View raw message