public class CoverageDoclet extends Object
Doclet that computes coverage of JavaDoc documentation.
It is the entry point for the JavaDoc Tool, which can be executed
either directly using the JavaDoc command line tool or from maven.ConsoleExporter,
Doclet Overview| Modifier and Type | Field and Description |
|---|---|
static String[] |
OUTPUT_NAME_OPTION
A command line parameter to enable defining the name of the coverage report.
|
| Constructor and Description |
|---|
CoverageDoclet(com.sun.javadoc.RootDoc rootDoc)
Instantiate the Doclet which will parse the JavaDocs and generate the coverage report.
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
getOptionValues(String[] optionNames)
Gets the values associated to a given command line option.
|
File |
getOutputFile(String fileName)
Gets a
File object from a given file name. |
com.sun.javadoc.RootDoc |
getRootDoc()
Gets the root element which enables reading JavaDoc documentation
from the Java files given to the JavaDoc tool.
|
PrintWriter |
getWriter(File file)
Gets a
PrintWriter used by the exporter to write
the coverage report to. |
static com.sun.javadoc.LanguageVersion |
languageVersion()
Gets the version of the Java Programming Language supported
by this doclet.
|
static int |
optionLength(String option)
Gets the number of arguments that a given command line option must contain.
|
static boolean |
start(com.sun.javadoc.RootDoc rootDoc)
Starts the actual parsing or JavaDoc documentation and generation of the coverage report.
|
static boolean |
validOptions(String[][] options,
com.sun.javadoc.DocErrorReporter errorReporter)
Validates command line options.
|
public static final String[] OUTPUT_NAME_OPTION
public CoverageDoclet(com.sun.javadoc.RootDoc rootDoc)
rootDoc - root element which enables reading JavaDoc documentationpublic static boolean start(com.sun.javadoc.RootDoc rootDoc)
rootDoc - root element which enables reading JavaDoc documentationDoclet.start(RootDoc)public static boolean validOptions(String[][] options, com.sun.javadoc.DocErrorReporter errorReporter)
options - the array of given optionserrorReporter - an object that allows printing error messages for invalid optionsDoclet.validOptions(String[][], DocErrorReporter)public static int optionLength(String option)
option - the command line optionDoclet.optionLength(String)public String[] getOptionValues(String[] optionNames)
optionNames - an array containing the valid names for the command line option to get its associated values.
This array may include the long and short versions of the option name,
for instance {-outputName, -o}.public static com.sun.javadoc.LanguageVersion languageVersion()
Doclet.languageVersion()public com.sun.javadoc.RootDoc getRootDoc()
public PrintWriter getWriter(File file) throws FileNotFoundException
PrintWriter used by the exporter to write
the coverage report to.file - the file to which the coverage report will be saved toFileNotFoundExceptionCopyright © 2017 Manoel Campos da Silva Filho. All rights reserved.