Javadoc API: How far are varargs supported?

java, javadoc, variadic-functions

Solution

Found it, its an attribute of the MethodDoc super class:

public interface ExecutableMemberDoc {

    public boolean isVarArgs();
    // Return true if this method was declared to 
    // take a variable number of arguments.

}

To make it work you have to put the following static (sic!) method and return value into your doclet class:

public static LanguageVersion languageVersion() {
    return LanguageVersion.JAVA_1_5;
}

Oki Doki. Case closed.

Problem

I want to write my custom doclet. I don't want to read some existing javadoc that is made with the standard doclet. I am having problems to figure out how I can query the Javadoc API whether a formal parameter is a varargs paramter. For example if I have the following method: ``` public static void main(String... args) { } ``` How can I determine that the formal parameter args is varargs? I have looked into com.sun.javadoc.Type. But was not able to figure out how to access the information. Bye P.S.: Reflection doesn't help, since reflection is not available inside a doclet I guess. In a doclet you have for example the MethodDoc reflected class, whereas in reflection you have the Method class.

Original source

Related problems