Class ToDoTaglet
- All Implemented Interfaces:
Taglet
With this taglet, it is possible to add a list of open points to the documentation of a module or a package. The parameter of the tag is the (absolute) path to a text file in Markdown format; this path will be combined with the path provided by the system property "org.tquadrat.foundation.todo.base" (if any).
In the file, each open point consists of a sequence of lines that will end with an empty line (a paragraph in Markdown). HTML tags are taken as they are, JavaDoc tags will be not interpreted.
So the module-info.java file for a project may look like
this:
/**
* …
*
* @todo /task.list
*/
module my.module
{
requires java.base;
requires …
exports …
}
With "org.tquadrat.foundation.todo.base" set to
"/home/programmer/project/", the file will be searched at
"/home/programmer/project/task.list".
Given the contents of that file looks like this:
Cleanup the class comments
Re-think the parser implementation
the generated Module description will look like this:
Module my.module…
…
|
With Maven or Gradle, the base path can be easily set to the project root.
The file is interpreted as Markdown since version 0.2.0, before it was a plain text file.
- Author:
- Thomas Thrien - thomas.thrien@tquadrat.org
- Version:
- $Id: ToDoTaglet.java 978 2022-01-06 12:47:52Z tquadrat $
- Since:
- 0.0.5
-
Nested Class Summary
Nested classes/interfaces inherited from interface jdk.javadoc.doclet.Taglet
Taglet.Location -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FileThe base path for the todo file.private DocletThe doclet.private DocletEnvironmentThe doclet environment.static final StringThe name of the property that holds the base path for the todo list: "org.tquadrat.foundation.todo.base".static final StringThe name of this taglet: "todo". -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Set<Taglet.Location> final StringgetName()final voidinit(DocletEnvironment docletEnvironment, Doclet doclet) final booleanprivate static final voidprocessFile(File file, StringBuilder buffer) Parses the given file as a Markdown files and adds the result to the providedStringBuilder.final StringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jdk.javadoc.doclet.Taglet
isBlockTag
-
Field Details
-
PROPERTY_TODO_BASE
The name of the property that holds the base path for the todo list: "org.tquadrat.foundation.todo.base". It will be set on thejavadoccommand line like this: "-J-Dorg.tquadrat.foundation.todo.base=…"- See Also:
-
TAGLET_NAME
The name of this taglet: "todo".- See Also:
-
m_BasePath
The base path for the todo file. -
m_Doclet
The doclet. -
m_DocletEnvironment
The doclet environment.
-
-
Constructor Details
-
ToDoTaglet
public ToDoTaglet()Creates a newToDoTagletinstance.
-
-
Method Details
-
getAllowedLocations
- Specified by:
getAllowedLocationsin interfaceTaglet
-
getName
-
init
-
isInlineTag
- Specified by:
isInlineTagin interfaceTaglet
-
processFile
Parses the given file as a Markdown files and adds the result to the provided
StringBuilder.- Parameters:
file- The file with the todo list.buffer- The destination for the output.
-
toString
-
