![]()
|
Javadoc/Javadoc2DescriptionGenerates code documentation using the javadoc tool. The source directory will be recursively scanned for Java source files to process but only those matching the inclusion rules, and not matching the exclusions rules will be passed to the javadoc tool. This allows wildcards to be used to choose between package names, reducing verbosity and management costs over time. This task, however, has no notion of "changed" files, unlike the javac task. This means all packages will be processed each time this task is run. In general, however, this task is used much less frequently. This task works seamlessly between different javadoc versions (1.1, 1.2 and 1.4), with the obvious restriction that the 1.2 attributes will be ignored if run in a 1.1 VM. NOTE: since javadoc calls System.exit(), javadoc cannot be run inside the same VM as ant without breaking functionality. For this reason, this task always forks the VM. This overhead is not significant since javadoc is normally a heavy application and will be called infrequently. NOTE: the packagelist attribute allows you to specify the list of packages to document outside of the Ant file. It's a much better practice to include everything migrate from regular makefiles, where you would use this option of javadoc. The packages listed in packagelist are not checked, so the task performs even if some packages are missing or broken. Use this option if you wish to convert from an existing makefile. Once things are running you should then switch to the regular notation. DEPRECATION: the javadoc2 task simply points to the javadoc task and it's there for back compatibility reasons. Since this task will be removed in future versions, you are strongly encouraged to use javadoc instead. In the table below, 1.1 means available if your current Java VM is a 1.1 VM, 1.2 for either 1.2 or 1.3 and 1.4 for a 1.4 Java VM. 1.2+ means any VM of at least version 1.2. Parameters
Format of the group attributeThe arguments are comma-delimited. Each single argument is 2 space-delimited strings, where the first one is the group's title and the second one a colon delimited list of packages. If you need to specify more than one group, or a group whose title contains a comma or a space character, using nested group elements is highly recommended. E.g., group="XSLT_Packages org.apache.xalan.xslt*,XPath_Packages org.apache.xalan.xpath*" Parameters specified as nested elementspackagesetA DirSet. All matched directories that contain Java source files will be passed to javadoc as package names. Package names are created from the directory names by translating the directory separator into dots. Ant assumes the base directory of the packageset points to the root of a package hierarchy. The filesetA FileSet. All matched
files will be passed to javadoc as source files. Ant will
automatically add the include pattern Nested filesets can be used to document sources that are in the default package or if you want to exclude certain files from documentation. If you want to document all source files and don't use the default package, packagesets should be used instead as this increases javadocs performance. The packageSame as one entry in the list given by Parameters
excludepackageSame as one entry in the list given by ParametersSame as forpackage .
sourceSame as one entry in the list given by Parameters
doctitleSame as the headerSimilar to footerSimilar to bottomSimilar to linkCreate link to javadoc output at the given URL. This performs the same role as the link and linkoffline attributes. You can use either syntax (or both at once), but with the nested elements you can easily specify multiple occurrences of the arguments. Parameters
groupSeparates packages on the overview page into whatever groups you specify, one group per table. This performs the same role as the group attribute. You can use either syntax (or both at once), but with the nested elements you can easily specify multiple occurrences of the arguments. Parameters
The title may be specified as a nested docletThe doclet nested element is used to specify the doclet that javadoc will
use to process the input source files. A number of the standard javadoc arguments
are actually arguments of the standard doclet. If these are specified in the javadoc
task's attributes, they will be passed to the doclet specified in the
If the doclet requires additional parameters, these can be specified with
<javadoc ... > <doclet name="theDoclet" path="path/to/theDoclet"> <param name="-foo" value="foovalue"/> <param name="-bar" value="barvalue"/> </doclet> </javadoc> tagThe tag nested element is used to specify custom tags. This option is only available with Java 1.4. Parameters
tagletThe taglet nested element is used to specify custom taglets. This option is only available with Java 1.4. Parameters
sourcepath, classpath and bootclasspath
Example<javadoc packagenames="com.dummy.test.*" sourcepath="src" excludepackagenames="com.dummy.test.doc-files.*" defaultexcludes="yes" destdir="docs/api" author="true" version="true" use="true" windowtitle="Test API"> <doctitle><![CDATA[<h1>Test</h1>]]></doctitle> <bottom><![CDATA[<i>Copyright © 2000 Dummy Corp. All Rights Reserved.</i>]]></bottom> <tag name="todo" scope="all" description="To do:" /> <group title="Group 1 Packages" packages="com.dummy.test.a*"/> <group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/> <link offline="true" href="http://java.sun.com/products/jdk/1.2/docs/api/" packagelistLoc="C:\tmp"/> </javadoc> is the same as <javadoc destdir="docs/api" author="true" version="true" use="true" windowtitle="Test API"> <packageset dir="src" defaultexcludes="yes"> <include name="com/dummy/test/**" /> <exclude name="com/dummy/test/doc-files/**"/> </packageset> <doctitle><![CDATA[<h1>Test</h1>]]></doctitle> <bottom><![CDATA[<i>Copyright © 2000 Dummy Corp. All Rights Reserved.</i>]]></bottom> <tag name="todo" scope="all" description="To do:" /> <group title="Group 1 Packages" packages="com.dummy.test.a*"/> <group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/> <link offline="true" href="http://java.sun.com/products/jdk/1.2/docs/api/" packagelistLoc="C:\tmp"/> </javadoc> or <javadoc destdir="docs/api" author="true" version="true" use="true" windowtitle="Test API"> <fileset dir="src" defaultexcludes="yes"> <include name="com/dummy/test/**" /> <exclude name="com/dummy/test/doc-files/**"/> </fileset> <doctitle><![CDATA[<h1>Test</h1>]]></doctitle> <bottom><![CDATA[<i>Copyright © 2000 Dummy Corp. All Rights Reserved.</i>]]></bottom> <tag name="todo" scope="all" description="To do:" /> <group title="Group 1 Packages" packages="com.dummy.test.a*"/> <group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/> <link offline="true" href="http://java.sun.com/products/jdk/1.2/docs/api/" packagelistLoc="C:\tmp"/> </javadoc> Copyright © 2000-2002 Apache Software Foundation. All rights Reserved. |