Currently, the OptionsDoclet Javadoc doclet ignores inner classes. This is
because I do not have a good solution to the following problem: given a
ClassDoc instance 'cd' which refers to class A, how do you get a Class<?>
instance corresponding to A?
Originally, I used 'Class.forName(cd.qualifiedName())'. This approach fails
when cd is an inner class.
The documentation for Class.forName() says the first parameter to this method
is a String representing the fully qualified name of a class. This is false.
In fact, the first parameter to Class.forName() must be a string representing
the *binary* name of the desired class. So what we have is cd.qualifiedName()
correctly returning a fully qualified name, and Class.forName() expecting a
binary name. Usually, when inner classes are not being used, this distinction
wont matter since the FQN and binary name are the same. But with Javarifier,
which has inner classes in its main class, we have the following:
javarifier.Main$JrTransformer is a binary name.
javarifier.Main.JrTransformer is a fully qualified name.
The Class.forName() method fails on the FQN of this class.
One solution would be a general method to translate from a fully qualified name
to a binary name. This method has to be robust and work correctly on all
cases. Another solution is to use calls to 'cd.containingClass()' to determine
which classes are inner classes and then make the appropriate replacements of
dots with dollar signs in the fully qualified name. Better yet, perhaps there
is a method of going from ClassDoc to Class<?> without using strings or names
at all. For now, my solution is to simply ignore any classes that are
contained within other classes. This means any @Option annotations in inner
classes will not be included in the generated HTML documentation.