Solved

auto generate java doc for new file in java (eclipse env)

Posted on 2013-10-24
5
641 Views
Last Modified: 2013-10-31
Hi,

I am working in eclipse , i have created a web project in java.

what i need is whenever i create a new java file the information like

copyright
author
datetime
...
...

should come automatically

How to achieve the above in eclipse?
0
Comment
Question by:Rocking
  • 3
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
Comment Utility
Go into Window -> Preferences and then in the tree on the left, drill down into Java -> Code Style -> Code Templates. Then on the right, open up the Comments parent item and configure whatever you need there. More than likely, for the info that you mention above, you would be looking at either the "Files" or the "Types" entries to be setup. Play with that and see how you go, and if you still have issues, post back here and we can help further.
0
 

Author Comment

by:Rocking
Comment Utility
i am doing the same but the problem is i need to auto generate the header/comments by rights click the java file, wht i need is the header part should be automatically added whenever the new file is created (i.e no need to do it manually).

Secondly if i need to create a template for java doc which i can use in other project is there any way to do it?
0
 
LVL 35

Expert Comment

by:mccarl
Comment Utility
I am unsure about the two items that you are asking about. It is hard to understand what you have written. I believe the solution that I posted should fulfil everything that you need.
0
 

Author Comment

by:Rocking
Comment Utility
Just need to confirm the steps you have provided will add comments(say header ) the moment java file is created or need to manually generate the java doc.
0
 
LVL 35

Expert Comment

by:mccarl
Comment Utility
Just need to confirm the steps you have provided
Yes they will. Hence why I posted them!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now