diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Doclet.java b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Doclet.java index 39a5f174ffb..981b73bb3ad 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Doclet.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/doclet/Doclet.java @@ -58,6 +58,16 @@ import javax.lang.model.SourceVersion; * * @since 9 */ +// +// TODO: (spec) Better define the call order. +// Define which methods are called when, by the container. +// E.g. at any time, or after or before some other method(s), etc. +// +// TODO: (spec) Specify that the container calls Doclet's and Option's methods +// in a thread-safe manner. That is, maybe by different threads, but never +// concurrently, and using all the necessary synchronization. So, the +// implementors of Doclets don't have to be concerned with any of that. +// public interface Doclet { /** @@ -67,6 +77,9 @@ public interface Doclet { * @param locale the locale to be used * @param reporter the reporter to be used */ + // + // TODO: (spec, wordsmithing?) What are these "doclet components"? + // void init(Locale locale, Reporter reporter); /** @@ -76,6 +89,9 @@ public interface Doclet { * * @return name of the Doclet */ + // + // TODO: (spec) How is this used? (E.g. maybe to identify Doclet to the user? + // String getName(); /** @@ -83,6 +99,11 @@ public interface Doclet { * * @return a set containing all the supported options, an empty set if none */ + // + // TODO: (spec) How is this method used? + // Should we say that this set *comprises* all the supported options? + // i.e. it contains all the options and nothing else. + // Set getSupportedOptions(); /** @@ -92,6 +113,12 @@ public interface Doclet { * @return the language version supported by this doclet, usually * the latest version */ + // + // TODO: (spec) What happens if the returned SourceVersion does not + // agree with the container? What is the semantics of this value? + // + // TODO: (impl) I couldn't find where it is called + // SourceVersion getSupportedSourceVersion(); /** @@ -101,17 +128,30 @@ public interface Doclet { * @param environment from which essential information can be extracted * @return true on success */ + // + // TODO: (spec) What does success mean here? How should Doclet decide + // what to return? What are the implications of returning false? + // Should a doclet in this case say something to "reporter"? + // boolean run(DocletEnvironment environment); /** * An encapsulation of option name, aliases, parameters and descriptions * as used by the Doclet. */ + // TODO: should we talk separately about typical options and then the + // options ending with ':' (e.g. "-Xdoclint:")? + // The latter are processed somewhat differently. For example, they + // bypass getArgumentCount + // interface Option { /** * Returns the number of arguments, this option will consume. * @return number of consumed arguments */ + // + // TODO: (spec) How is this method used? + // int getArgumentCount(); /** @@ -119,12 +159,21 @@ public interface Doclet { * return the synopsis of the option such as, "groups the documents". * @return description if set, otherwise an empty String */ + // + // TODO: (spec) How is this method used? + // + // TODO: (spec) Should it mention that this should better be localized + // as it probably displayed to the user? + // String getDescription(); /** * Returns the option kind. * @return the kind of this option */ + // + // TODO: (spec) How is this method used? + // Option.Kind getKind(); /** @@ -133,12 +182,21 @@ public interface Doclet { * option "-classpath", with an alias "--class-path". * @return the names of the option */ + // + // TODO: (spec) The returned list must have at least one name. + // Probably link to some good naming conventions + // (e.g. GNU, https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html#Command_002dLine-Interfaces). + // List getNames(); /** * Returns the parameters of the option. For instance "name <p1>:<p2>.." * @return parameters if set, otherwise an empty String */ + // + // TODO: (spec) How is this method used? + // Is there a link between this method and getArgumentCount? + // String getParameters(); /** @@ -148,6 +206,18 @@ public interface Doclet { * @param arguments a list encapsulating the arguments * @return true if operation succeeded, false otherwise */ + // + // TODO: (spec) what is the "option" parameter? Is it one of the names + // from `getNames()`? + // + // TODO: (spec) What are the effects of the returned value? + // + // TODO: (spec) Can this method be called on the same option more than + // once? If so, then Doclet is in charge of keeping all the + // necessary state accumulated between the calls. + // + // TODO: (spec) Specify exactly how this