Asif Ahmed
Asif Ahmed

Reputation: 93

javadoc for all - private, public and protected members

I want to have a javadoc where all - private , public, protected members are shown. In eclipse I am having option to make javadoc for either of the three, not for all the three types of members. How can I accomplish this?? no option to add all

Upvotes: 1

Views: 1303

Answers (3)

Rudy Vissers
Rudy Vissers

Reputation: 5477

Make usage of the '-private'

Let's give you an example:

The following command line will process all the packages under com and LOR (lord of the rings) located into /home/rudy/IdeaProjects/demo/src/main/java and /home/rudy/IdeaProjects/demo/src/test/java/

Please note:

  • it is Linux and the paths and packages are separated by ':'.
  • that I made usage of '-private' and wanted all the classes and members to be documented.

rudy@rudy-ThinkPad-T590:~$ javadoc -d /home/rudy/IdeaProjects/demo_doc
-sourcepath /home/rudy/IdeaProjects/demo/src/main/java/
:/home/rudy/IdeaProjects/demo/src/test/java/
-subpackages com:LOR 
-private

rudy@rudy-ThinkPad-T590:~/IdeaProjects/demo/src/main/java$ ls -R 
.: com LOR
./com: example
./com/example: demo
./com/example/demo: DemowApplication.java
./LOR: Race.java TolkienCharacter.java

rudy@rudy-ThinkPad-T590:~/IdeaProjects/demo/src/test/java$ ls -R 
.: com
./com: example
./com/example: demo
./com/example/demo: AssertJTest.java DemowApplicationTests.java

Upvotes: 0

Jokke
Jokke

Reputation: 71

Using the terminal, simply use the javadoc command with the -private argument. For example javadoc *.java -private to generate javadoc for all .java files in the current directory. Example output

Upvotes: 0

user85421
user85421

Reputation: 29680

The option that you can set on the Javadoc export wizard is just the lower bound of which classes and members will be documented. Upper bound is always "public".

Options:

  • Public: only public classes and members,
  • Protected: protected and public classes and members,
  • Package: package, protected and public classes and members,
  • Private: all classes and members

Upvotes: 1

Related Questions