This discussion is archived
4 Replies Latest reply: Dec 15, 2008 10:06 AM by 796542 RSS

Not getting package description in javadoc..

796542 Newbie
Currently Being Moderated
Hi,

When i am trying to create the javadoc for the following program then i am not getting the description of java doc..
/**


*This _packeage_ is used for eReview. 


*/

*
package com.eReview;

*

 

*
import java.awt.Image;

**
import java.net.MalformedURLException;

**
import java.net.URL;

*

 


/**


* This Testing class is used to generate _url_, image and name..


* *@author* _sunita_ _xxx_


* 


*


*/


 

*
public *class *Sunita {

*

 


/**


* Default constructor for Inventory


* Sets all ingredients to 15 units


*/


*public* Sunita() {


// *TODO* Auto-generated constructor stub


}


 


/**


* returns image, _url_ and name


* *@param* url


* *@param* name


* *@return* null


* *@throws* MalformedURLException


*/


*public* Image getImage(URL url, String name)*throws* MalformedURLException {


*try* {


*return* getImage(url, name);


} *catch* (MalformedURLException e) {


*return* *null*;


}


} 


/**


* Returns the units of coffee in the Inventory


* *@param* args


* set the vale of amount of coffee


* *@return* boolean


* *@return* _int_


*/


*public* *int* getAmtCoffee(String args) {


*int* amtCoffee=15;


*return* amtCoffee;


}


 


/**


* this main class shows the name of the author


* *@param* args 


*/


*public* *static* *void* main(String[] args) {


// *TODO* Auto-generated method stub


System.+out+.println("sunita");


}


}
****************************************************************************************************************************************

When i am creating the javadoc of the above class sunita.java then i am getting the following output


Package Class Use Tree Deprecated Index Help

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES


--------------------------------------------------------------------------------


Package com.eReview

*----------------->Here i want the description of package that i have written in the above java class (This packeage is used for eReview.)*
But its not coming here...Kindly help me how to do this one???

Class Summary
Sunita This Testing class is used to generate url, image and name..




--------------------------------------------------------------------------------
Package Class Use Tree Deprecated Index Help

PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES


--------------------------------------------------------------------------------

  • 1. Re: Not getting package description in javadoc..
    thomas.behr Newbie
    Currently Being Moderated
    The package description cannot be included in a normal Java source file but has to be placed into a dedicated package description file. See [http://java.sun.com/j2se/javadoc/writingdoccomments/index.html#packagecomments] and [http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#packagecomment].
  • 2. Re: Not getting package description in javadoc..
    796542 Newbie
    Currently Being Moderated
    Hi thomas,

    thanks for ur reply..Yes i already went through this link before..But i did not get the concepts clearly..So i posted this query..If anbody can tell me briefly then its great for me..
  • 3. Re: Not getting package description in javadoc..
    thomas.behr Newbie
    Currently Being Moderated
    Ok, suppose you have a file system structure of <java project source directory>/com/eReview/Sunita.java and Sunita.java contains
    /**
     * This _package_ is used for eReview.
     */
    package com.eReview;
    
    import java.awt.Image;
    import java.net.MalformedURLException;
    import java.net.URL;
    
    /**
     * This Testing class is used to generate _url_, image and name..
     * @author _sunita_ _xxx_
     */
    public class Sunita {
    
      /**
       * Default constructor for Inventory
       * Sets all ingredients to 15 units
       */
      public Sunita() {
        // TODO Auto-generated constructor stub 
      }
    
      /**
       * returns image, _url_ and name
       * @param url
       * @param name
       * @return null
       * @throws MalformedURLException
       */
      public Image getImage(URL url, String name)throws MalformedURLException {
        try {
          return getImage(url, name);
        } catch (MalformedURLException e) {
          return null;
        }
      } 
    
      /**
       * Returns the units of coffee in the Inventory
       * @param args
       * set the vale of amount of coffee
       * @return boolean
       * @return _int_
       */
      public int getAmtCoffee(String args) {
        int amtCoffee=15;
        return amtCoffee;
      }
    
      /**
       * this main class shows the name of the author
       * @param args 
       */
      public static void main(String[] args) {
        // TODO Auto-generated method stub
        System.out.println("sunita");
      }
    }
    (Note, I removed a few asteriks that were cluttering the sample code.)
    First remove the comment above the package declaration
    /**
     * This _package_ is used for eReview.
     */
    from Sunita.java. Then create a file called package.html in directory <java project source directory>/com/eReview. Open that file in your favorite editor and add the package documentation. This documenation should be bracketed by HTML body tags. I.e. for your simple example, the package.html's content should look like this:
    <body>
    This \_package\_ is used for eReview.
    </body>
    JavaDoc automatically recognizes the contents of package.html as the package description and will include it at the appropriate location.
  • 4. Re: Not getting package description in javadoc..
    796542 Newbie
    Currently Being Moderated

    Hi thomas,

    Yes its working now.......

    Thanks a lot....