jQuery in Action, 2nd edition*
The moose likes Beginning Java and the fly likes javadoc help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "javadoc help" Watch "javadoc help" New topic
Author

javadoc help

Mike Lipay
Ranch Hand

Joined: Sep 11, 2007
Posts: 171
I tried running javadoc against both of my .java files and received an error that there were no public or protected classes, I thought they both had public classes. Below is one of the java files and the error I received.

Software.java



Error message
Hunter McMillen
Ranch Hand

Joined: Mar 13, 2009
Posts: 492

Just change


to:


I thought they were public by default. Maybe the javaDoc generator needed an explicit public definition to function. Not really sure.

-Hunter

"If the facts don't fit the theory, get new facts" --Albert Einstein
Mike Lipay
Ranch Hand

Joined: Sep 11, 2007
Posts: 171
that was it, thanks. I also assumed that public was the default.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

Mike Lipay wrote:that was it, thanks. I also assumed that public was the default.

Don't assume anything. It's the #1 cause for errors.

And no, the default access means a class or member is only visible to classes in the same package. Apart from private, it's the most restrictive visibility.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
If you want to document package private / private classes
there are options you could pass to javadoc.

just type javadoc... check the following extract..

G:\>javadoc
javadoc: error - No packages or classes specified.
usage: javadoc [options] [packagenames] [sourcefiles] [@files]
-overview <file> Read overview documentation from HTML file
-public Show only public classes and members
-protected Show protected/public classes and members (default)
-package Show package/protected/public classes and members
-private Show all classes and members
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Also note that your whitespace-based formatting won't work: Javadoc creates HTML output (by default), so the extra spaces will be invisible.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

But that can be solved using <table>, <pre> or some other nice HTML tag.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javadoc help
 
Similar Threads
Code review
Ok, applauded a little too soon...sort problem
Writeing / Reading ArrayList
Best way to serialize an object?
Array Objects - sorting?