blob: 0c2e69620864275544d87800f370e1ee23c70477 [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>ajdoc</title><link rel="stylesheet" href="aspectj-docs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.44"><link rel="home" href="index.html" title="The AspectJtm Development Environment Guide"><link rel="up" href="ajdoc-ref-top.html" title="ajdoc, the AspectJ documentation tool"><link rel="previous" href="ajc-ref.html" title="ajc"><link rel="next" href="aj-ref-top.html" title="aj, the AspectJ load-time weaving script"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ajdoc</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ajc-ref.html">Prev</a>&nbsp;</td><th width="60%" align="center"><tt>ajdoc</tt>, the AspectJ documentation tool</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="aj-ref-top.html">Next</a></td></tr></table><hr></div><div class="refentry"><h1 class="title"><a name="ajdoc-ref"></a>ajdoc</h1><div class="refnamediv"><a name="d0e806"></a><h2>Name</h2>ajdoc &#8212; generate HTML API documentation, including crosscutting structure (early-access)
</div><div class="refsynopsisdiv"><a name="d0e811"></a><h2>Synopsis</h2><div class="cmdsynopsis" id="d0e812"><a name="d0e812"></a><tt>ajdoc</tt> [
-bootclasspath <i><tt>classpathlist</tt></i>
] [
-classpath <i><tt>classpathlist</tt></i>
] [-d <i><tt>path</tt></i>] [-help] [-package] [-protected] [-private] [-public] [-overview <i><tt>overviewFile</tt></i>] [
-sourcepath <i><tt>sourcepathlist</tt></i>
] [-verbose] [-version] [<i><tt>sourcefiles...</tt></i> | <i><tt>packages...</tt></i> | @<i><tt>file...</tt></i> | -argfile <i><tt>file...</tt></i>]</div></div><div class="refsect1"><a name="d0e867"></a><h2>Description</h2><p>
Similar to <b>javadoc</b>,
<b>ajdoc</b> renders HTML documentation for pointcuts,
advice, and inter-type declarations, as
well as the Java constructs that Javadoc renders.
<b>ajdoc</b> also links
advice from members affected by the advice and
the inter-type declaration for members declared from aspects.
The aspect will be fully documented,
as will your target classes, including links to any
advice or declarations that affect the class.
That means, for example, that
you can see everything affecting a method when reading
the documentation for the method.
</p><p>
To run <b>ajdoc</b>, use one of the scripts in the
AspectJ <tt>bin</tt> directory.
The <b>ajdoc</b> implementation builds on Sun's <b>javadoc</b>
command line tool, and you use it in the same way with many of
the same options
(<b>javadoc</b> options are not documented here;
for more information on <b>javadoc</b> usage, see the
<a href="http://java.sun.com/j2se/javadoc/" target="_top">Javadoc homepage</a>.)
</p><p>
As with <b>ajc</b> (but unlike <b>javadoc</b>),
you pass <b>ajdoc</b> all your aspect source files
and any files containing types affected by the aspects;
it's often easiest to just pass all the <tt>.java</tt> files
in your system.
Unlike <b>ajc</b>,
<b>ajdoc</b> will try to find package sources using the
specified sourcepath if you list packages on the command line.
</p><p>
To provide an argfile listing the source files, you can use
use the same argfile (<tt>@filename</tt>) conventions
as with <b>ajc</b>.
For example, the following documents all the source files listed
in <tt>argfile.lst</tt>, sending the output to
the <tt>docDir</tt> output directory.
<pre class="programlisting">ajdoc -d docDir @argfile.lst</pre>
See the <a href="ajc-ref.html#ajc" title="Description">ajc documentation</a>
for details on the text file format.
</p><p>
<b>ajdoc</b> currently requires the
<tt>tools.jar</tt> from J2SE 1.3 to be on the classpath.
Normally the scripts set this up, assuming that your <tt>JAVA_HOME</tt>
variable points to an appropriate installation of Java.
You may need to provide this jar when using a different
version of Java or a JRE.
</p></div><div class="refsect1"><a name="d0e955"></a><h2>Known limitations</h2><p>
<b>ajdoc</b> documents advice and pointcut members, shows where advice applies and
links affected members back to the advice.
It currently does not document or add structural links for any inter-type declarations or other declare forms.
</p></div><div class="refsect1"><a name="d0e963"></a><h2>Examples</h2><div class="example"><p><a name="ajdocdocumentingspacewar"></a><b>Example 2.4. Documenting Spacewar</b></p><div class="itemizedlist"><ul><li><p><a name="d0e971"></a>
Change into the <tt>examples</tt> directory.
</p></li><li><p><a name="d0e977"></a>
Type <b><tt>mkdir doc</tt></b> to create the
destination directory for the documentation.
</p></li><li><p><a name="d0e983"></a>
Type <b><tt>ajdoc -private -d doc spacewar
coordination</tt></b> to generate the documentation.
</p><div class="itemizedlist"><ul><li><p><a name="d0e990"></a>
(Use <tt>-private</tt> to get all members, since
may of the interesting ones in spacewar are not public.)
</p></li></ul></div></li><li><p><a name="d0e996"></a>
Type <b><tt>ajdoc -private -d doc @spacewar/demo.lst</tt></b>
to use the argfile associated with Spacewar.
</p></li><li><p><a name="d0e1002"></a>
To view the documentation, open the file <tt>index.html</tt>
in the <tt>doc</tt> directory using a web browser.
</p></li></ul></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ajc-ref.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="aj-ref-top.html">Next</a></td></tr><tr><td width="40%" align="left">ajc&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ajdoc-ref-top.html">Up</a></td><td width="40%" align="right">&nbsp;<tt>aj</tt>, the AspectJ load-time weaving script</td></tr></table></div></body></html>