How to javadoc non-.java files? -- Can it be done?
Is there a way to get javadoc generated for non-.java files? We are using WebLogic Workshop and they have some proprietary file extensions (.jpf, .jcx, .jcs) they are using, however, the code inside of them is just like a java file. We have a lot of javadoc in those files, but it is not generated/recognized when we run javadoc. Is there something that can be done to make javadoc try and parse files with non-.java extensions? We are using eclipse to generate our javadoc.
Thanks in advance.
[506 byte] By [
wood_taha] at [2007-10-3 5:25:46]

What do you mean "just like a java file"? Does it contain class, constructor, method and field declarations? Javadoc comments are interpreted only ahead of these declarations.
The javadoc tool is limited to java source files. It's pretty much a precondition of the javadoc tool that a source file must be able to be compiled by the javac compiler. Javadoc uses parts of javac to parse the source file and build a doc structure, using javac internal data structures. If your files cannot be compiled by javac, they are unlikely to be parsed by the javadoc tool (though there are exceptions for Java source files that have compiler errors). Javadoc tool also looks for the ".java" extension on files.
Yes, the file contains class, constructor, method and field declarations. I think the only reason it has a different file extension is so that proprietary annotations can be parsed to autogenerate other files.
I am not sure exactly how these classes are compiled -- WebLogic's IDE just "knows" how to compile these. I am sure if I dig deeper, I can find out. I was just wondering if there was a properties file or something out there where I could add the extensions I wanted included in the javadoc.
If anybody out there is using WebLogic Workshop and is familiar with these files and had created their own javadoc, please let me know how.
I see. No, there's no properties file to hold other file extensions. I would bet that WebLogic's IDE processes these files to generate temporary .java files which it then compiles. The trick would be to access those .java files.
You could have a pre-process script that copies the source tree, renaming the files to .java extensions. Then javadoc could run on those. If the proprietary annotations have no impact on the docs, then the docs you generate should be just fine.
We didn't anticipate that other file extensions would be used when we designed Javadoc.