Results 1 to 10 of 10
  1. #1
    jon80's Avatar
    jon80 is offline Senior Member
    Join Date
    Feb 2008
    Location
    Malta (EU)
    Posts
    211
    Rep Power
    7

    Default Javadoc - cannot compile @param tags

    Does anyone know the syntax for including @param tags within the generated javadoc documents?

    :confused:

    I searched high and low but could not find this information in the documentation and command line help, in a manner that I could understand it.

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    Have a look at the Java API source code for numerous examples.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  3. #3
    jon80's Avatar
    jon80 is offline Senior Member
    Join Date
    Feb 2008
    Location
    Malta (EU)
    Posts
    211
    Rep Power
    7

    Default

    API source code?

  4. #4
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    This should help you


    Java Code:
    /**These are the Javadoc comments.  They use a slash
     * two asterisks, comments/tags, an asterisk, and another
     * slash.  They describe the method after them
     * 
     * @param s the parameter of this method
     */
    public void myMethod(String s){
    	//method code
    }
    The asterisks on each line are not necessary, only the /** and */ at the beginning and end. Note that all tags must be at the end of the comment, after the description
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by jon80 View Post
    API source code?
    Didn't you ever seen Java API source code? Check for a zip file named src inside the Java installation folder.

  6. #6
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    Lol... personally, I would never try looking through Java source. Too much for me, and I don't really want to see the original Java code. I do have plenty of code with Javadoc comments though, if my earlier post didn't help.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

  7. #7
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Sometime it useful to me lol. Looking at the source code, I'm able to find different logic in developments.

  8. #8
    jon80's Avatar
    jon80 is offline Senior Member
    Join Date
    Feb 2008
    Location
    Malta (EU)
    Posts
    211
    Rep Power
    7

    Default

    Presume you're talking about

    ..\jdk1.6.0_13\src.zip which I had extracted to ..\src

    lol it sure does contain numerous sub-folders

    Anyway I checked my code (again) and it just seems correct. I don't see a description of the @param. The funny thing is that the javadoc generated excludes one of the classes (Employee), and that there is a warning icon next to the class within Eclipse (even though it compiles when running the project).
    Java Code:
    /*
    	 * @param employee - any object of the Employee class.
    	 */
    	//5. Operators
     @Override public boolean equals (Object anotherObject) 
    	{

  9. #9
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    19

    Default

    Quote Originally Posted by jon80 View Post
    Presume you're talking about

    ..\jdk1.6.0_13\src.zip which I had extracted to ..\src

    lol it sure does contain numerous sub-folders

    Anyway I checked my code (again) and it just seems correct. I don't see a description of the @param. The funny thing is that the javadoc generated excludes one of the classes (Employee), and that there is a warning icon next to the class within Eclipse (even though it compiles when running the project).
    Java Code:
    /*
    	 * @param employee - any object of the Employee class.
    	 */
    	//5. Operators
     @Override public boolean equals (Object anotherObject) 
    	{
    Yes, it contains large number of sub-folders. All of them are packages you are using in your applications, using import statement.

  10. #10
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    Your parameter is non-existant. That would cause problems. Also, double asterisk at the beginning (/** instead of /*) for Javadoc. Single asterisk is for regular comments.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

Similar Threads

  1. HOw to run ant javadoc
    By Manfizy in forum New To Java
    Replies: 24
    Last Post: 02-18-2009, 09:59 PM
  2. JavaDoc
    By javarishi in forum Eclipse
    Replies: 1
    Last Post: 04-10-2008, 08:41 AM
  3. jsp:param action
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-24-2007, 10:03 AM
  4. what can I do with javadoc
    By christina in forum Advanced Java
    Replies: 1
    Last Post: 07-25-2007, 11:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •