You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Rafal Krzewski <kr...@e-point.pl> on 2000/06/28 03:36:52 UTC

link and linkoffline parameters in javadoc

Hello everybody!

	Lately, I've been learning to use Javadoc, and I noticed that
Ant does't handle multiple link parameters, which can come quite
handy if you want your API documetation to have links to Java API
and Xerces and Xalan and everything else you use. This makes the
documentation look much cooler :)
	Adding this functionality was quite simple, and it works for
me now. My patch is enclosed at the end of the message. There are
two long lines that probably got wrapped, sorry...

Rafal Krzewski

-cut----------------------------------------------------------------------------------------------------
diff -u -r1.8 Javadoc.java
--- Javadoc.java	2000/06/14 12:42:14	1.8
+++ Javadoc.java	2000/06/28 00:28:32
@@ -358,13 +358,42 @@
                 argList.addElement("-bottom");
                 argList.addElement(bottom);
             }
+
+            // JavaDoc documentation from JDK 1.3:
+            //   Multiple Links - You can supply multiple -link options to link to any number of external generated documents.
+            //   Known Bug - Javadoc 1.2 has a known bug which prevents you from supplying more than one -link command. This is
fixed in 1.2.2.
+
+            // Ant javadoc task rules for list attribute:
+            //   Args are comma-delimited.
             if (link != null) {
-                argList.addElement("-link");
-                argList.addElement(link);
+                StringTokenizer tok = new StringTokenizer(link, ",", false);
+                while (tok.hasMoreTokens()) {
+                    String lnk = tok.nextToken().trim();
+                    argList.addElement("-link");
+                    argList.addElement(lnk);
+                }
             }
+
+            // JavaDoc documentation from JDK 1.3:
+            //   Include -linkoffline once for each generated document you want to refer to.
+
+            // Ant javadoc task rules for list attribute:
+            //   Args are comma-delimited.
+            //   Each arg is 2 space-delimited strings.
+            //   E.g., linkoffline="http://xml.apache.org/apiDocs/
${src.dir}/javadoc/xerces-packages,http://xml.apache.org/xalan/apidocs ${src.dir}/javadoc/xalan-packages"
             if (linkoffline != null) {
-                argList.addElement("-linkoffline");
-                argList.addElement(linkoffline);
+                StringTokenizer tok = new StringTokenizer(linkoffline, ",", false);
+                while (tok.hasMoreTokens()) {
+                    String lnk = tok.nextToken().trim();
+                    int space = lnk.indexOf(" ");
+                    if (space > 0) {
+                        String remote = lnk.substring(0, space);
+                        String local = lnk.substring(space + 1);
+                        argList.addElement("-linkoffline");
+                        argList.addElement(remote);
+                        argList.addElement(local);
+                    }
+                }
             }

             // Javadoc 1.2 rules:
-cut----------------------------------------------------------------------------------------------------


RE: link and linkoffline parameters in javadoc

Posted by Rafal Krzewski <kr...@e-point.pl>.
> Yes my patch covers this problem.
> I initially did the same thing as you do, with a coma 
> separated list, but
> after some discussion in this list I implemented it as nested 
> tags for the
> javadoc tag.
> It will be available as soon as Conor checks it in.

I'm glad to hear that! Nested tags are definetly cleaner solution
than a list.

Rafal

Re: link and linkoffline parameters in javadoc

Posted by Patrick Chanezon <ch...@netscape.com>.
Yes my patch covers this problem.
I initially did the same thing as you do, with a coma separated list, but
after some discussion in this list I implemented it as nested tags for the
javadoc tag.
It will be available as soon as Conor checks it in.

P@

Conor MacNeill wrote:

> Rafal,
>
> I am already working on committing a patch for this from Patrick Chanezon.
> He submitted it a while ago. I think it will cover your needs.
>
> Thanks
> Conoror
>
> --
> Conor MacNeill
> Home: conor@m64.com
> Work: conor@cortexebusiness.com.au
> Web:  www.cortexebusiness.com.au
>
> ? -----Original Message-----
> ? From: Rafal Krzewski [mailto:krzewski@e-point.pl]
> ? Sent: Wednesday, 28 June 2000 11:37
> ? To: ant-dev@jakarta.apache.org
> ? Subject: link and linkoffline parameters in javadoc
> ?
> ?
> ? Hello everybody!
> ?
> ?       Lately, I've been learning to use Javadoc, and I noticed that
> ? Ant does't handle multiple link parameters, which can come quite
> ? handy if you want your API documetation to have links to Java API
> ? and Xerces and Xalan and everything else you use. This makes the
> ? documentation look much cooler :)
> ?       Adding this functionality was quite simple, and it works for
> ? me now. My patch is enclosed at the end of the message. There are
> ? two long lines that probably got wrapped, sorry...
> ?
> ? Rafal Krzewski
> ?
> ? -cut--------------------------------------------------------------
> --------------------------------------
> ? diff -u -r1.8 Javadoc.java
> ? --- Javadoc.java      2000/06/14 12:42:14     1.8
> ? +++ Javadoc.java      2000/06/28 00:28:32
> ? @@ -358,13 +358,42 @@
> ?                  argList.addElement("-bottom");
> ?                  argList.addElement(bottom);
> ?              }
> ? +
> ? +            // JavaDoc documentation from JDK 1.3:
> ? +            //   Multiple Links - You can supply multiple -link
> ? options to link to any number of external generated documents.
> ? +            //   Known Bug - Javadoc 1.2 has a known bug which
> ? prevents you from supplying more than one -link command. This is
> ? fixed in 1.2.2.
> ? +
> ? +            // Ant javadoc task rules for list attribute:
> ? +            //   Args are comma-delimited.
> ?              if (link != null) {
> ? -                argList.addElement("-link");
> ? -                argList.addElement(link);
> ? +                StringTokenizer tok = new StringTokenizer(link,
> ? ",", false);
> ? +                while (tok.hasMoreTokens()) {
> ? +                    String lnk = tok.nextToken().trim();
> ? +                    argList.addElement("-link");
> ? +                    argList.addElement(lnk);
> ? +                }
> ?              }
> ? +
> ? +            // JavaDoc documentation from JDK 1.3:
> ? +            //   Include -linkoffline once for each generated
> ? document you want to refer to.
> ? +
> ? +            // Ant javadoc task rules for list attribute:
> ? +            //   Args are comma-delimited.
> ? +            //   Each arg is 2 space-delimited strings.
> ? +            //   E.g., linkoffline="http://xml.apache.org/apiDocs/
> ? ${src.dir}/javadoc/xerces-packages,http://xml.apache.org/xalan/api
> ? docs ${src.dir}/javadoc/xalan-packages"
> ?              if (linkoffline != null) {
> ? -                argList.addElement("-linkoffline");
> ? -                argList.addElement(linkoffline);
> ? +                StringTokenizer tok = new
> ? StringTokenizer(linkoffline, ",", false);
> ? +                while (tok.hasMoreTokens()) {
> ? +                    String lnk = tok.nextToken().trim();
> ? +                    int space = lnk.indexOf(" ");
> ? +                    if (space ? 0) {
> ? +                        String remote = lnk.substring(0, space);
> ? +                        String local = lnk.substring(space + 1);
> ? +                        argList.addElement("-linkoffline");
> ? +                        argList.addElement(remote);
> ? +                        argList.addElement(local);
> ? +                    }
> ? +                }
> ?              }
> ?
> ?              // Javadoc 1.2 rules:
> ? -cut--------------------------------------------------------------
> --------------------------------------
> ?
> ?

--
Patrick Chanezon, iPlanet Market Maker- Portal/EServices Technical Lead
Netscape Communications Corp. - http://people.netscape.com/chanezon/
Opinions are my own.

"Two monks were arguing about a flag. One said: `The flag is moving.'
The other said: `The wind is moving.'
The sixth patriach happened to be passing by. He told them: `Not the wind, not
the flag; mind is moving.'"
Zen Koan


RE: link and linkoffline parameters in javadoc

Posted by Conor MacNeill <co...@m64.com>.
Rafal,

I am already working on committing a patch for this from Patrick Chanezon.
He submitted it a while ago. I think it will cover your needs.

Thanks
Conoror


--
Conor MacNeill
Home: conor@m64.com
Work: conor@cortexebusiness.com.au
Web:  www.cortexebusiness.com.au


> -----Original Message-----
> From: Rafal Krzewski [mailto:krzewski@e-point.pl]
> Sent: Wednesday, 28 June 2000 11:37
> To: ant-dev@jakarta.apache.org
> Subject: link and linkoffline parameters in javadoc
>
>
> Hello everybody!
>
> 	Lately, I've been learning to use Javadoc, and I noticed that
> Ant does't handle multiple link parameters, which can come quite
> handy if you want your API documetation to have links to Java API
> and Xerces and Xalan and everything else you use. This makes the
> documentation look much cooler :)
> 	Adding this functionality was quite simple, and it works for
> me now. My patch is enclosed at the end of the message. There are
> two long lines that probably got wrapped, sorry...
>
> Rafal Krzewski
>
> -cut--------------------------------------------------------------
--------------------------------------
> diff -u -r1.8 Javadoc.java
> --- Javadoc.java	2000/06/14 12:42:14	1.8
> +++ Javadoc.java	2000/06/28 00:28:32
> @@ -358,13 +358,42 @@
>                  argList.addElement("-bottom");
>                  argList.addElement(bottom);
>              }
> +
> +            // JavaDoc documentation from JDK 1.3:
> +            //   Multiple Links - You can supply multiple -link
> options to link to any number of external generated documents.
> +            //   Known Bug - Javadoc 1.2 has a known bug which
> prevents you from supplying more than one -link command. This is
> fixed in 1.2.2.
> +
> +            // Ant javadoc task rules for list attribute:
> +            //   Args are comma-delimited.
>              if (link != null) {
> -                argList.addElement("-link");
> -                argList.addElement(link);
> +                StringTokenizer tok = new StringTokenizer(link,
> ",", false);
> +                while (tok.hasMoreTokens()) {
> +                    String lnk = tok.nextToken().trim();
> +                    argList.addElement("-link");
> +                    argList.addElement(lnk);
> +                }
>              }
> +
> +            // JavaDoc documentation from JDK 1.3:
> +            //   Include -linkoffline once for each generated
> document you want to refer to.
> +
> +            // Ant javadoc task rules for list attribute:
> +            //   Args are comma-delimited.
> +            //   Each arg is 2 space-delimited strings.
> +            //   E.g., linkoffline="http://xml.apache.org/apiDocs/
> ${src.dir}/javadoc/xerces-packages,http://xml.apache.org/xalan/api
> docs ${src.dir}/javadoc/xalan-packages"
>              if (linkoffline != null) {
> -                argList.addElement("-linkoffline");
> -                argList.addElement(linkoffline);
> +                StringTokenizer tok = new
> StringTokenizer(linkoffline, ",", false);
> +                while (tok.hasMoreTokens()) {
> +                    String lnk = tok.nextToken().trim();
> +                    int space = lnk.indexOf(" ");
> +                    if (space > 0) {
> +                        String remote = lnk.substring(0, space);
> +                        String local = lnk.substring(space + 1);
> +                        argList.addElement("-linkoffline");
> +                        argList.addElement(remote);
> +                        argList.addElement(local);
> +                    }
> +                }
>              }
>
>              // Javadoc 1.2 rules:
> -cut--------------------------------------------------------------
--------------------------------------
>
>