The Jadexdoc Tool is a documentation tool similar to the Javadoc tool.
It provides the ability to generate HTML pages for
ADF (Agent Description File) documentation from Jadex source files.
The Jadexdoc tool parses the declarations and documentation comments
in a set of agent description files and produces a corresponding set of
HTML pages describing the agents, capabilities, beliefs,
goals, plans, events and expressions. You can use it to generate the ADF
documentation or the implementation documentation for a set of agents and
capabilities. The Jadexdoc tools can be run together with the Javadoc
tool in order to document the agents as well as the used Java classes.
Jadexdoc will use the generated Javadoc documentation and generate links for
the corresponding classes.
You can run the Jadexdoc tool on entire packages, individual
source files, or both. When documenting entire packages, you can either traverse
recursively down from a top-level directory, or pass in an explicit list of
package names. When documenting individual source files, you pass in a list of
source (.agent.xml
or .capability.xml
)
filenames.
The easiest way to use the Jadexdoc tool is via the plugin which provides a gui simplifying the documentation task:
There are three basic panels in this graphical tool. The model tree on the left hand side, the package panel and the settings panel. They will be described in detail below.
On the left upper side there is the model tree which is already known from other tools such as the starter tool (see Section 3.1, “Model Tree”):
With this panel you can manage adding packages or single files to your selection of files of which you want to create the Javadoc/Jadexdoc. For this purpose the following actions are available via popup (and also partially via the tool bar above):
For adding the selected package to the list of packages to document.
For adding the selected package and all recursivly contained subpackages
to the list of packages to document.
For removing the selected package to the list of packages to document.
For removing the selected package and all recursivly contained subpackages
to the list of packages to document.
In the middle you can find a panel which displays selections of “Packages”, “Source Paths”, “Class Paths” and “URL Links”:
The“Packages” tab shows the packages and files that should be documented by the Jadexdoc and Javadoc tools.
In the “Source Paths” tab the path(s) to the sources of the packages and files to document can be defined. In case of Jadexdoc source paths are normally not that important because the ADF files are contained in the "classes" folder, too. With respect to Javadoc source path are more important as Javadoc always needs the Java source files for accessing the Javadoc comments which are not present in the compiled classes any more.
In the “Class Paths” tab the class path can be edited. This can be done either by hand or by clicking on the “Fetch” button which results in fetching the currently used class paths.
If you finally choose the tab “URL Links” you can specify locations you want to cross-link to in your doc-files. If you click on fetch this will insert an entry for the URL to the Standard JDK Java API. This will enable Javadoc and Jadexdoc to generate links for the standard Java classes such as String, Integer etc.
On the right hand side you can find the settings panel, where some detailed settings for Javadoc and Jadexdoc and be defined:
The "Include subpackes" check box can be used for automatically including subpackages. This means if this option is checked the tools will generate documentation for all selected packages (and files) and all of the recursively contained subpackages.
Via the "Output directory" textfield it can be defined to which directory the documentation should be generated. The standard output directory is the current directory. The
button can be used to select another appropriate target directory.The "Overview page" represents the top-level page for the whole generated documentation and contains information about the contained packages. The
button can be used to select a custom overview HTML page. The overview page will only be included when the corresponding check box is selected.The "Document title" option can be used for specifying the title to be placed near the top of the overview summary file. The title will be placed as a centered, level-one heading directly beneath the upper navigation bar. The title will only be included when the corresponding check box is selected.
The "Basic options" can be used to turn on/off several generation features. The hierarchy tree is a page containing agents and capabilities displayed in usage relationships. The navigation bar offers possibilities to refer to related documentation pages. It can be turned off if you are interested only in the content and have no need for navigation, e.g. when converting the files to PostScript or PDF for print only. The index holds an alphabetical list of elements. It can be adjusted with an options in a way that only one letter per page is generated.
The "Generate Javadoc" check box can be used to turn on/off the invocation of the Javadoc tool.
In the extra options text field an arbitrary number of additional Javadoc command line options can be specified.
The "Javadoc program location" option allows for specifying the program location of the Javadoc tool, which belongs to the standard JDK edition.
The "Generate Jadexdoc" check box can be used to turn on/off the invocation of the Jadexdoc tool.
In the extra options text field an arbitrary number of additional Jadexdoc command line options can be specified.
The "Java program location" option allows for specifying the program location of the Java program (e.g. java.exe on Windows systems), which belongs to the standard JDK edition and is required for the invocation of the Jadexdoc tool.
During the documentation generation, there will appear an animated icon in the bottom
right corner. While running Javadoc, it shows a Java icon scanned by a red bar
, while running Jadexdoc, an icon with an agent scanned by a red bar is displayed
.
The Jadexdoc and Javadoc tools both use the standard Java output and error streams (System.out and System.err) for printing out information about the generation progress. The console panel of the JCC allows for inspecting these outputs directly in the tool (see also Section 2.1, “Using the JCC”).
On the top right of the console outputs, there are two buttons. With the left one, you can turn on and off the console output during a run, with the right one you can clear the console.
You can start the Jadexdoc tool from a console via:
java jadex.tools.jadexdoc.Main [options] [packagenames] [sourcefilenames] [-subpackage pck1:..]Description. Arguments can be in any order. See processing of Source Files for details on how the Jadexdoc tool determines which source files to process.
options. Command-line options, as specified in this document. The section options below contains examples of Jadexdoc options.
packagenames.
A series of names of packages, separated by spaces, such as
jadex.examples jadex.planlib
.
You must separately specify each package you want to document.
Wildcards are not allowed; use -subpackages
for recursion.
For further details see the section Section 9.6, “Options”.
sourcefilenames. A series of source file names, separated by spaces, each of which can begin with a path and contain a wildcard such as asterisk (*). The Jadexdoc tool will process every file whose name ends with ".agent.xml" or ".capability.xml".
-subpackages pck1:pck2:...
Generates documentation from source files in the specified packages and
recursively in their subpackages as an alternative to supplying packagenames or
sourcefilenames.
The Jadexdoc tool will generate output originating from four different types of "source" files: Agent and Capability source files, package comment files, overview comment files, and miscellaneous unprocessed files.
Processing of source files. The Jadexdoc tool processes files that end with ".agent.xml" and ".capability.xml" plus other files described below. If you run the Jadexdoc tool by explicitly passing in individual source filenames, you can determine exactly which ADF files are processed. However, that is not how most developers want to work, as it is simpler to pass in package names.
Package Comment Files. Each package can have its own documentation comment, contained in its own "source" file, that the Jadexdoc tool will merge into the package summary page that it generates. You typically include in this comment any documentation that applies to the entire package.
To create a package comment file, you must name it
package.html
and place it
in the package directory in the source tree along with the agent description
files. The Jadexdoc tool will automatically look for this filename in this
location. Notice that the filename is identical for all packages.
The content of the package comment file is one big documentation comment, written
in HTML, like all other comments. When writing the comment,
you should make the first sentence a summary about the package, and not put a title
or any other text between <body>
and the
first sentence.
When the Jadexdoc tool runs, it will automatically look for this file; if found, the Jadexdoc tool does the following:
Copies all content between
<body>
and
</body>
tags for
processing.
Inserts the processed text at the bottom of the package summary page it generates, as shown in Package Summary.
Copies the first sentence of the package comment to the top of the package summary page. It also adds the package name and this first sentence to the list of packages on the overview page.
Overview Comment File. Each application or set of packages that you are documenting can have its own overview documentation comment, kept in its own "source" file, that the Jadexdoc tool will merge into the overview page that it generates. You typically include in this comment any documentation that applies to the entire application or set of packages.
To create an overview comment file, you can name the file anything you want,
typically overview.html
and place it anywhere, typically at the top
level of the source tree. The content of the overview comment file is one big documentation comment,
written in HTML, like the package comment file described previously.
When you run the Jadexdoc tool, you specify the overview comment file name with
the -overview
option. The file is then processed similar to that of a package
comment file.
Copies all content between <body>
and
</body>
tags for processing.
Inserts the processed text at the bottom of the overview page it generates.
Copies the first sentence of the overview comment to the top of the overview summary page.
Miscellaneous Unprocessed Files. You can also include in your source any miscellaneous files that you want the Jadexdoc tool to copy to the destination directory. These typically includes graphic files, example agent description files, and self-standing HTML files whose content would overwhelm the documentation comment of a normal agent description file.
To include unprocessed files, put them in a directory called doc-files
which
can be a subdirectory of any package directory that contains source files. You can
have one such subdirectory for each package. For example, if you want to include
the image of a creature Creature.png
in the
jadex.examples.hunterprey.creature.CleverPrey
agent documentation, you place
that file in the jadex/examples/hunterprey/creature/doc-files/
directory.
Notice the doc-files
directory should not be located at
jadex/examples/doc-files/
because examples
does not
directly contain any source files.
All links to these unprocessed files must be hard-coded, because the Jadexdoc
tool does not look at the files, it simply copies the directory and all its
contents to the destination. For example, the link in the
CleverPrey.agent.xml
doc comment might look like:
<!-- The image of the CleverPrey agent: <img src="doc-files/Creature.png"> -->
By default, Jadexdoc uses a standard doclet that generates HTML-formatted
documentation. This doclet generates the following kinds of files (where each
HTML "page" corresponds to a separate file). Note that Jadexdoc
generates files with two types of names:
those named after agents/capabilities, and those that are not (such as
package-summary.html
).
Files in the latter group contain hyphens to prevent
filename conflicts with those in the former group.
Basic Content Pages.
One agent (agentname.agent.html
)
or capability (capabilityname.capability.html
)
page for each agent or capability is documented.
One package page (package-summary.html
)
for each package it is documenting. The Jadexdoc tool will include any
HTML text provided in a file named
package.html
in the package directory of the source tree.
One overview page (overview-summary.html
) for
the entire set of packages.
This is the front page of the generated document. The Jadexdoc tool will include
any HTML text provided in a file specified with the
-overview
option. Note that this file is created only if you pass
into Jadexdoc two or more package names.
Cross-Reference Pages.
One agent/capability hierarchy page for the
entire set of packages (overview-tree.html
).
To view this, click on "Overview" in the navigation bar, then click on
"Tree".
One agent/capability hierarchy page for each package
(package-tree.html
). To view this, go to a particular package, agent or
capability page; click "Tree" to display the hierarchy for that package.
An index (index-*.html
) of all agent,
capabilities, beliefs, plans, goals, events and expressions names,
alphabetically arranged.
Support Files.
A help page (help-doc.html
) that
describes the navigation bar and the above pages. You can provide your own custom help file to
override the default using -helpfile
.
One index.html
file
which creates the HTML frames for display. This
is the file you load to display the front page with frames. This file itself contains
no text content. Several frame files (*-frame.html
) containing lists of
packages, agents and capabilities, used when HTML frames are being displayed.
A style sheet file (stylesheet.css
)
that controls a limited amount of color, font family, font size, font style
and positioning on the generated pages.
A doc-files
directory that holds any image, example,
source code or other files that you want copied to the destination directory.
Commenting the Source Code.
You can include documentation comments in the agent description files, ahead of
declarations for any agent, capability, plan, goal, event or expression, etc.
You can also create comments for each package and another one for the overview,
though their syntax is slightly different. The comments in the agent description
files are regular xml-comments consisting of the characters between the
characters <!-- that begin the comment and the characters -->
that end it. The text in a comment can continue onto multiple lines.
<!-- This is the typical format of a simple documentation comment that spans multiple lines. --> <!-- To save space you can also put a comment on one line. -->
Placement of comments. Documentation comments are recognized only when placed immediately before agent, capability, belief, goal, plan, event or expression declarations. Only one documentation comment per declaration statement is recognized by the Jadexdoc tool.
<!-- This is the comment for the agent 'MyAgent' --> <agent name="MyAgent" package="jadex.examples.myagents"> <beliefs> <!-- The comment for the belief 'MyBelief' --> <belief name="MyBelief" class="Object"/> </beliefs> </agent>
Comments are written in HTML.
The texts can be written in HTML, in that they should use
HTML entities and can use HTML tags. You can
use whichever version of HTML your browser supports. The
bold HTML tag <b>
is shown in the following example.
<!-- This is a <b>documentation</b> comment. -->
First sentence. The first sentence of each documentation comment should be a summary sentence, containing a concise but complete description of the declared member. This sentence ends at the first period that is followed by a blank, tab, or line terminator. The Jadexdoc tool copies this first sentence to the member summary at the top of the HTML page. For convenience, Jadexdoc strips any html tags from this sentence, when it is displayed in a summary table.
The Jadexdoc tool uses a standard doclet to determine its output. The Jadexdoc tool provides a set of command-line options that can be used with any doclet. These options are described below under the sub-heading Section 9.6.1, “Jadexdoc Options”. The standard doclet provides an additional set of command-line options that are described below under the sub-heading Options Provided by the Standard Doclet. All option names are case-insensitive, though their arguments can be case-sensitive.
-subpackages
pck1:pck2:...
Generates documentation from source files in the specified packages and recursively
in their subpackages. This option is useful when adding new subpackages
to the source code, as they are automatically included. Each package argument is
any top-level subpackage (such as jadex
) or fully qualified package (such as
jadex.examples
) that does not need to contain source files. Arguments are
separated by colons (on all operating systems). Wildcards are not needed or allowed.
java jadex.tools.jadexdoc.Main -d docs -subpackages jadex.examples.hunterprey:jadex.examples.cleanerworld
You can use -subpackages
in conjunction with
-exclude
to exclude specific packages.
-exclude
pck1:pck2:...
Unconditionally excludes the specified packages and their subpackages from the
list formed by -subpackages
. It excludes those packages even if they would
otherwise be included by some previous or later -subpackages
option.
java jadex.tools.jadexdoc.Main -d docs -subpackages jadex -exclude jadex.planlib:jadex.examples.testcases
-help
Displays the online help, which lists these Jadexdoc and doclet command line options.
-quiet
Shuts off non-error and non-warning messages, leaving only the warnings and errors appear, making them easier to view. Also suppresses the version string.
-d
directory
Specifies the destination directory where Jadexdoc saves the generated
HTML files. Omitting this option
causes the files to be saved to the current directory. The value directory can
be absolute, or relative to the current working directory. The destination
directory is automatically created when Jadexdoc is run. For example, the
following generates the documentation for the package
jadex.examples.testcases
and saves the results in the user/doc
directory:
java jadex.tools.jadexdoc.Main -d user/doc jadex.examples.testcases
-overview
path/filename
Specifies that Jadexdoc should retrieve the text for the overview documentation
from the "source" file specified by path/filename
and place it
on the Overview page (overview-summary.html
). While you can use any name you
want for filename and place it anywhere you want for path, a typical thing to do
is to name it overview.html
and place it in the source tree at the directory
that contains the topmost package directories. Note that the overview page is
created only if you pass into Jadexdoc two or more package names. The title on
the overview page is set by -doctitle
.
-splitindex
Splits the index file into multiple files, alphabetically, one file per letter, plus a file for any index entries that start with non-alphabetical characters.
-windowtitle
title
Specifies the title to be placed in the HTML <title>
tag.
This appears in the window title and in any browser bookmarks (favorite places) that someone
creates for this page. This title should not contain any HTML tags, as the
browser will not properly interpret them. Any internal quotation marks within
title may have to be escaped. If -windowtitle
is omitted, the Jadexdoc tool uses
the value of -doctitle
for this option.
java jadex.tools.jadexdoc.Main -windowtitle "Jadex Examples" jadex.examples
-doctitle
title
Specifies the title to be placed near the top of the overview summary file. The title will be placed as a centered, level-one heading directly beneath the upper navigation bar. The title may contain html tags and white space, though if it does, it must be enclosed in quotes. Any internal quotation marks within title may have to be escaped.
java jadex.tools.jadexdoc.Main -doctitle "<b>Jadex Agent Dokumentation<b>" jadex.examples.testcases
-header
header
Specifies the header text to be placed at the top of each output file. The
header will be placed to the right of the upper navigation bar.
header
may contain HTML tags
and white space, though if it does, it must be enclosed in quotes. Any internal
quotation marks within header may have to be escaped.
java jadex.tools.jadexdoc.Main -header "<b>Jadex Platform</b><br>0.96" jadex.examples.testcases
-footer
footer
Specifies the footer text to be placed at the bottom of each output file. The
footer will be placed to the right of the lower navigation bar. footer
may
contain html tags and white space, though if it does, it must be enclosed in quotes.
Any internal quotation marks within footer may have to be escaped.
-bottom
text
Specifies the text to be placed at the bottom of each output file. The text will be placed at the bottom of the page, below the lower navigation bar. The text may contain HTML tags and white space, though if it does, it must be enclosed in quotes. Any internal quotation marks within text may have to be escaped.
-link
extdocURL
The -link
option enables you to link to java classes referenced to by your members
in the agent description file. For these links to go to valid pages, you
must know where those HTML pages are located, and specify that location with
extdocURL. This allows, for instance, a jadex doc file to link to java.*
documentation on http://java.sun.com.
When Jadexdoc is run without the -link
option, when it encounters a java class, it prints the fully qualified name with
no link. However, when the -link
option is used, the Jadexdoc tool searches
the package-list
file at the specified extdocURL
location for that
package name. If it finds the package name, it creates a link to the external
Javadoc location.
extdocURL
is the absolute or relative
URL of the directory containing the external javadoc-generated
documentation you want to link to. Examples are shown below. The package-list
file must be found in this directory (otherwise, use -linkoffline
).
The Jadexdoc tool reads the package names from the
package-list file and then links to those packages at that
URL. When the Jadexdoc tool is run, the
extdocURL
value is copied literally into the
<A HREF> links that are created. Therefore, extdocURL
must be the
URL to the directory, not to a file. You can use an absolute link for extdocURL
to enable your docs to link to a document on any website, or can use a relative
link to link only to a relative location. If relative, the value you pass in
should be the relative path from the destination directory (specified with
-d
)
to the directory containing the packages being linked to. In all cases, and on
all operating systems, you should use a forward slash as the separator, whether
the URL is absolute or relative, and "http:" or "file:"
based (as specified in theURL Memo).
Absolute http: based link:
-link http://<host>/<directory>/<directory>/.../<name>
Absolute file: based link:
-link file://<host>/<directory>/<directory>/.../<name>
Relative link:
-link <directory>/<directory>/.../<name>
You can specify multiple -link
options in a given
Jadexdoc run to link to multiple documents.
Choosing between -linkoffline
and -link
.
Use -link
: when using a relative path to the external API document,
or when using an absolute URL to the external API document,
if your shell allows a program to open a connection to that URL for reading.
Use -linkoffline
: when using an absolute
URL to the external API document,
if your shell does not allow a program to open a connection to that
URL for reading. This can occur if
you are behind a firewall and the document you want to link to is on
the other side.
Example 9.1. Example using absolute links to the external docs
Let's say you want to link to the Java 2 Platform packages at
http://java.sun.com/javase/6/docs/api/.
The following command generates documentation for the package
jadex.examples
with links to the Java 2 Platform packages.
java jadex.tools.jadexdoc.Main -link http://java.sun.com/javase/6/docs/api/ -subpackages jadex.examples
Example 9.2. Example using relative links to the external docs
Let's say you have user defined java packages whose docs are
generated with the Javadoc tool. Then you use the Jadexdoc tool to
document the corresponding agent description files and those docs
are separated by a relative path. In this example, the API
(Application Programming Interface) packages reside in
docs/api/jadex/examples
and the ADF (agent description files) packages in
docs/adf/jadex/examples
.
Assuming the API package documentation is already generated, and that docs is
the current directory, you would document the ADF package with links to the API
documentation by running:
java jadex.tools.jadexdoc.Main -d ../adf -link ../api -subpackages jadex.examples
The -link
argument is relative to the destination directory.
In order to avoid broken links, all of the documentation for the external references
must exist at the specified URLs. The Jadexdoc tool will not check that
these pages exist only that the package-list exists.
Multiple Links.
You can supply multiple -link
options to link to any
number of external generated documents. Specify a different link option for
each external document to link to:
java jadex.tools.jadexdoc.Main -link extdocURL1
-link extdocURL2
... -subpackages jadex.examples
where extdocURL1
, extdocURL2
,
... point respectively to the roots of external documents, each of which contains a file named
package-list
.
-linkoffline
extdocURL packagelistLoc
This option is a variation of -link
; they both create links to javadoc-generated
documentation for external referenced classes. Use the -linkoffline
option
when linking to a document on the web when the Javadoc tool itself is
"offline" that is, it cannot access the document through a web
connection.
The -linkoffline
option takes two arguments the first for the string to be
embedded in the <a href> links, the second telling it where to find package-list:
extdocURL
is the absolute or relative
URL of the directory containing the external javadoc-generated
documentation you want to link to. If relative, the value should be the relative path
from the destination directory (specified with -d
)
to the root of the packages being linked to. For more details, see
extdocURL
in the
-link
option.
packagelistLoc
is the path or
URL to the directory containing the
package-list file for the external documentation. This can be a
URL (http: or file:) or file path, and can be absolute
or relative. If relative, make it relative to the current directory
from where Javadoc was run. Do not include the
package-list
filename.
You can specify multiple -linkoffline
options in a given
Jadexdoc run.
-group
groupheading packagepattern:packagepattern:...
Separates packages on the overview page into whatever groups you specify, one
group per table. You specify each group with a different
-group
option. The groups appear on the page in the order specified
on the command line; packages are alphabetized within a group. For a given
-group
option, the packages matching the list of packagepattern
expressions appear in a table with the heading
groupheading
.
groupheading
can be any text, and can include white
space. This text is placed in the table heading for the group.
packagepattern
can be any package name, or can be the
start of any package name followed by an asterisk (*). The asterisk is a wildcard
meaning "match any characters". This is the only wildcard allowed. Multiple
patterns can be included in a group by separating them with colons (:).
If using an asterisk in a pattern or pattern list, the pattern list must be inside quotes, such as "jadex.examples*"
If you do not supply any -group
option, all packages are placed in one group
with the heading Packages. If the groups do not include all
documented packages, any leftover packages appear in a separate group with the heading
Other Packages.
java jadex.tools.jadexdoc.Main -group "Core Packages" "jadex.planlib" -group "Hunterprey Packages" "jadex.examples.hunterprey*" -subpackages jadex.examples
-notree
Omits the agent/capability hierarchy pages from the generated docs. These are the pages you reach using the "Tree" button in the navigation bar. The hierarchy is produced by default.
-noindex
Omits the index from the generated docs. The index is produced by default.
-nohelp
Omits the "Help" link in the navigation bars at the top and bottom of each page of output.
-nonavbar
Prevents the generation of the navigation bar, header and footer, otherwise
found at the top and bottom of the generated pages. Has no affect on the
"bottom" option. The -nonavbar
option is useful when you are
interested only in the content and have no need for navigation.
-helpfile
path/filename
Specifies the path of an alternate help file path/filename
that the
"Help" link in the top and bottom navigation bars link to. Without this option,
the Jadexdoc tool automatically creates a help file help-doc.html
.
This option enables you to override this default. The filename can be any name.
The Jadexdoc tool will adjust the links in the navigation bar accordingly.
java jadex.tools.jadexdoc.Main -helpfile C:\user\myhelp.html -subpackages jadex.examples
-stylesheetfile
path/filename
Specifies the path of an alternate HTML stylesheet file. Without this option,
the Jadexdoc tool automatically creates a stylesheet file stylesheet.css
. This
option enables you to override this default. The filename can be any name.
java jadex.tools.jadexdoc.Main -stylesheetfile C:\user\mystylesheet.css -subpackages jadex.examples
-docfilessubdirs
Enables deep copying of "doc-files" directories. In other words,
subdirectories and all contents are recursively copied to the destination. For
example, the directory
doc-files/example/images
and all its contents would now
be copied. There is also an option to exclude subdirectories.
-excludedocfilessubdir
name1:name2...
Excludes any
doc-files
subdirectories with the given names.
-noqualifier
all | packagename1:packagename2:...
Omits qualifying package name from ahead of agent/capability
and
class/interface names in output. The argument to
-noqualifier
is either
all
(all package qualifiers are omitted) or a colon-separated list of
packages, with wildcards, to be removed as qualifiers. The package name is
removed from places where agent/capability or class/interface names appear.
-nocomment
Suppress the entire comment body, including the main description, generating only declarations.