33919
|
1 |
|
|
2 |
SampleAPI Generator for javadoc
|
|
3 |
|
|
4 |
1. General description
|
|
5 |
|
|
6 |
The primary goal is to provide one or more data sets to be used as input
|
|
7 |
to the javadoc tool, such that it can be used to generate representative samples
|
|
8 |
of all the different content on all the different types of pages that can be
|
|
9 |
generated by javadoc.
|
|
10 |
|
|
11 |
The tool is implemented as generator based on xml descriptions of data sets.
|
|
12 |
The xml description of data set provides top level entities (class, interface,
|
|
13 |
enum, annotation) with all possible content. Desired output parameters (fields,
|
|
14 |
methods, inner/nested classes) are also described in xml as lists of modifiers,
|
|
15 |
types and annotations. The generator "multiply" the entities from the lists
|
|
16 |
providing the set of all possible combinations.
|
|
17 |
|
|
18 |
After the api generation the tool connects the javadoc style comments to
|
|
19 |
the generated entities with full possible sets of supported tags.
|
|
20 |
|
|
21 |
2. Tool structure
|
|
22 |
|
|
23 |
Sources:
|
|
24 |
test/tools/javadoc/sampleapi/lib - generator sources
|
|
25 |
test/tools/javadoc/sampleapi/res/xml - sample data sets in xml
|
|
26 |
test/tools/javadoc/sampleapi/res/txt - sample texts for doc comments
|
|
27 |
|
|
28 |
3. Public API
|
|
29 |
|
|
30 |
3.1 Command line runner
|
|
31 |
|
|
32 |
* test/tools/javadoc/sampleapi/lib/sampleapi/SampleApiDefaultRunner.java
|
|
33 |
|
|
34 |
class sampleapi.SampleApiDefaultRunner
|
|
35 |
|
|
36 |
Options: [-?|-h|--help] [-o:<dir>|--outdir:<dir>]
|
|
37 |
-?|-h|--help - print help
|
|
38 |
-o:<dir>|--outdir:<dir> - set <dir> to generate output
|
|
39 |
|
|
40 |
3.2 Programmatic access
|
|
41 |
|
|
42 |
* test/tools/javadoc/sampleapi/lib/sampleapi/SampleApi.java
|
|
43 |
|
|
44 |
class sampleapi.SampleApi
|
|
45 |
|
|
46 |
public void generate(File dir)
|
|
47 |
public void generate(Path dir)
|
|
48 |
public void generate(String dir)
|
|
49 |
|
|
50 |
3.3 How to run other xml data set description
|
|
51 |
|
|
52 |
Put data set xml description into res/xml directory
|
|
53 |
|
|
54 |
* test/tools/javadoc/sampleapi/lib/sampleapi/generator/PackageGenerator.java
|
|
55 |
|
|
56 |
class sampleapi.generator.PackageGenerator
|
|
57 |
|
|
58 |
public void processDataSet(String dsName)
|
|
59 |
public void generate(File outDir)
|