You need to sign in to do that
Don't have an account?

Using javadoc to generate Apex code documentation
Is anyone doing this successfully? We're at a point where I'd like to migrate from just using regular code comments to using full blown javadoc-accessible documentation, to make it easier and more appealing for our devs to reuse code.
Can anyone provide any examples of generating javadoc html from the .cls files stored by Eclipse?
Hello,
We have also encountered this problem and haven't been able to find a third party tool which could generate JavaDoc style documentation.
So having said that we took it upon our selfs to create such a plugin in Java. This is still a work in progress, but what I can say is that it will comply with all standard JavaDoc tags ( including some new ones we've added ), will create a HTML base API documentation similar to Javadoc, it will be able to run as a standalone app or installed as a Eclipse plugin.
We have high hopes for this and as soon as it enters a beta testing phase , it will be publicly available to everyone.
So i'll keep everyone posted on the progress of this.
piz
hi,
were you able to make any headway here?
@ mmenafra
Did you make any more progress on this yet?
Anybody found any solution.
Hi All,
I created one tool, this may be what you need.
http://www.aslambari.com/apexdoc.html
Thanks
Aslam Bari
I was disappointed with ApexDoc, since it's trying to be Doxygen/javadoc from scratch. It's a very simple parser that wouldn't even match my "@param" tag since it didn't have a "* " in front of it.
Here's a question I've posted on Stack Overflow that will hopefully get some responses.
In my opinion, getting Doxygen to generate documentation is the way to go. Whether we accomplish that with changes to Doxygen, or tools to convert an Apex .cls file to a dummy Java .java file that Doxygen can handle, I don't know.
-Tom
We had some code, tried ApexDoc and didn't like it since we wrote javadoc and were too
lazysmart to change it.So... we added some SED and got this cobbled together - This fits out use case, but could def. be refined. What follows is a BASH script that should work if you're running a Mac.
(That last sed command should be all on one line...)
I've made some improvements to ApexDoc. Check out the writeup here:http://scox67.blogspot.com/2013/08/sf-apexdoc.html.
In a nutshell, SfApexDoc:
I'm actively working on fixing issues and adding features, so please send me a note if you find problems.
find src -name \*.cls -print0 |xargs -0 -n 100 perl -pi.bak -e 'undef $/; s/(\s+)(with\s+sharing|without\s+sharing|testmethod)(\s+)/$1$3/gi; s/(\n[ \t]*)([^\n]*?)(\w+)(\s*\{\s*(private\s+|public\s+|protected\s+|)(get|set)\s*[;\{])/$1$2$3;$1private class Mutator_$3$4/ig; s/([\{\};]\s*)(private\s+|public\s+|)get(\s*[\{\};])/$1$2Object get()$3/ig; s/([;\{\}]\s*)(private\s+|public\s+|)set(\s*[;\{\}])/$1$2void set(Object value)$3/ig'
and use the following settings in doxygen:
EXTENSION_MAPPING = cls=Javascript
FILE_PATTERNS = *.cls
Then doxygen will produce reasonable output. The setters and getters are what confuse doxygen most, and the script takes care of that. Most of the other attibutes are seem to work fine in javascript mode, as well as using the apostrophe for strings. There is probably some usage this still misses. If find when doxygen gets confused it simply stops parsing the rest of the file.