aspose file tools
The moose likes IDEs, Version Control and other tools and the fly likes Bean Creator Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply Bookmark "Bean Creator" Watch "Bean Creator" New topic
Author

Bean Creator

Gregg Bolinger
Sheriff

Joined: Jul 11, 2001
Posts: 15040

Does anyone know of a Tool that will create a simple Bean java file. For example, let's say I have a Bean that has getter and setter methods for 50 different pieces of data.
Is there a tool that I can plug in my data types and variable names and it will create all my getter and setter methods based on that given data?
I am lazy and just get tired of typing

for a lot of data, over and over and over and over and.......
You get the idea.
thanks.


My Blog | DZone Articles
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1812
I've got a couple that I've developed myself. If you're interested, I can provide one, but it is a C++ Console-based application that is compiled for Windows. (The other is not really mine to distribute....). Simply enter your variable anmes and types and it will produce code for C, C++, Java, Objective-C, Scheme, LISP and Perl
In the near future I will be working on one written in Java.
If you're interested, e-mail me and I can provide it.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Sam Kebab
Ranch Hand

Joined: Jan 23, 2002
Posts: 104
If you want get and set methods generated - you can do it in both Netbeans and Eclipse.
For Netbeans just 1)type out all your instance variables inside the class: e.g. private int id; ... etc. 2) click highlight the name e.g in this case id 3) right click 4) with the popup choose generate get and set methods. You should have your get and set.
Note: Regarding this feature, IMHO Eclipse is better than Netbeans. If memory serves me right you can highlight all your instance variables in one go and then there is a pop-up or a button that generates all get and set at the same time.
I am tired of typing too.
Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
IDEA does the same. It allows to to select which instance variables you want and to specify whether you want the get..() and the set() generated.
It also allows you to automate the creation of constructors with parameters that map to instance variables.
I don't know of any small utility that allows you to do this. The alternatives are something like Xdoclet that would allow you to define your entities in an XML format and then automatically generate the Value Objects etc for them.


Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams
 
 
subject: Bean Creator
 
Threads others viewed
setter/getter in bean - overengineering?
Is JAX-WS method ArrayList
Using Logic:iterate with an string array
bean:write
h:inputText's binding attribute is not properly working under the a4j:repeat tag
developer file tools