views:

125

answers:

2

I've got one really big .java class file that has a lot of members. How do I create HTML documentation for this so it shows me the members in order of appearance, without sorting by member type? (methods, constants and variables)

For example if my Java code is:

 private int typeOfAction_1;      // notice the order:  1,2,3..
 public void startAction_2(){
 }

 private int jobtype_3;
 private int jobcount_4;
 private void doJob_5(){
 }

 public void haltAction_6(){
 }

Javadoc orders members in alphabetical order and sorted by type, and therefore the relations between members are lost:

int jobcount_4;        // notice how the order is lost:  4,3,1..
int jobtype_3;
int typeOfAction_1;

doJob_5()
haltAction_6()
startAction_2()

Also, are there documentation generates with smarter features? like:

  1. Extraction of nearby comments for methods & variables
  2. Size of methods - Lines of Code
+4  A: 

Javadoc's standard doclet does not support customized display order for methods. If you need this feature, you will need to develop a custom doclet (or find an existing one that satisfies your requirements).

There are a number of document generators other than Javadoc that can handle java. Doxygen and ROBODoc are two such tools. I believe that both of these tools provide the option for items (e.g. methods) to appear in the same order in the generated documentation as they appear in the source code.

Brandon E Taylor
I could use any other documentation generator that's capable of reading java class files.
Jenko
I added some information about two tools other than Javadoc that you might consider using.
Brandon E Taylor
A: 

Another possible approach would be simply to factor out the members that belong together into a separate class or classes, if they really are that conceptually separate from the other members in the class...

Willie Wheeler
The class is working perfectly and its not your every John's program. Its so complex I would rather understand it without attempting to redesign it.
Jenko
Sure, understood. I can't resist pointing out that the sort of case you describe is exactly the one where refactoring can help. Unfortunately I don't have a helpful answer for you regarding documentation though. :-|
Willie Wheeler