This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Generate getters and setters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Generate getters and setters" Watch "Generate getters and setters" New topic

Generate getters and setters

Gnanavelan Ganeshan

Joined: Dec 30, 2007
Posts: 4
how to generate getters and setters at runtime using java code with out any tool

is this possible ?

Dave Meyers

Joined: Mar 28, 2003
Posts: 5
I know of no way to do this. What are you trying to accomplish?
David Newton

Joined: Sep 29, 2008
Posts: 12617

I suppose you could do it at load time, but personally I'd want to be *really* sure that's what I wanted to do before embarking down that path: there be dragons.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38039
At runtime? That doesn't sound at all easy. Maybe impossible. And I agree with David Newton's "there be dragons."
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60785

What is your motivation for this rather bizarre requirement?

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Generate getters and setters
Similar Threads
Problem formatting dates.
I have a POJO ,Now I want to generate mapping File (.hbm) and table .Hoe It can be done?
Recieving 'null' values from a jsp page in Struts2 Action
hbm2java - private members ?
Eclipse training