You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by st...@daydream.stanford.edu on 2003/04/21 07:16:55 UTC

[OT] redundant code generation for setters/getters

Hi,

I've had to make many web forms with many entries. Which means I had to
make a bunch of accessors/mutators (setters/getters) for all the action
classes.  That can be quite cumbersome, so I made my own tool using basic
"cat" and "sed" in Unix.

I list all the names of the methods in a file and it uses a template to
generate the methods along with the comments. I do the same for the
declarations using the same file. I then just paste in the output.

Maybe others have better ways of doing this. If so, what do you use?

If anyone is interested in the tool I'm developing, I'll post it on my
website. For Win32 users, you'd need cygwin of course.

Oscar




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: [OT] redundant code generation for setters/getters

Posted by Affan Qureshi <qu...@etilize.com>.
Your IDE might have some features for this. I use NetBeans and it has
Generate Getters/Setters option in tools context menu. Also it allows you to
generate properties when defining a class.

----- Original Message -----
From: <st...@daydream.stanford.edu>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, April 21, 2003 10:16 AM
Subject: [OT] redundant code generation for setters/getters


> Hi,
>
> I've had to make many web forms with many entries. Which means I had to
> make a bunch of accessors/mutators (setters/getters) for all the action
> classes.  That can be quite cumbersome, so I made my own tool using basic
> "cat" and "sed" in Unix.
>
> I list all the names of the methods in a file and it uses a template to
> generate the methods along with the comments. I do the same for the
> declarations using the same file. I then just paste in the output.
>
> Maybe others have better ways of doing this. If so, what do you use?
>
> If anyone is interested in the tool I'm developing, I'll post it on my
> website. For Win32 users, you'd need cygwin of course.
>
> Oscar
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: [OT] redundant code generation for setters/getters

Posted by James Mitchell <jm...@apache.org>.
I've done the same thing using simple JavaScript in a broswer.  Type your
fields and types in one textarea and hit 'go' and then cut and paste the
result from another textarea to your editor.  Simple stuff.


--
James Mitchell
Software Developer/Struts Evangelist
http://www.open-tools.org



----- Original Message -----
From: <st...@daydream.stanford.edu>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, April 21, 2003 1:16 AM
Subject: [OT] redundant code generation for setters/getters


> Hi,
>
> I've had to make many web forms with many entries. Which means I had to
> make a bunch of accessors/mutators (setters/getters) for all the action
> classes.  That can be quite cumbersome, so I made my own tool using basic
> "cat" and "sed" in Unix.
>
> I list all the names of the methods in a file and it uses a template to
> generate the methods along with the comments. I do the same for the
> declarations using the same file. I then just paste in the output.
>
> Maybe others have better ways of doing this. If so, what do you use?
>
> If anyone is interested in the tool I'm developing, I'll post it on my
> website. For Win32 users, you'd need cygwin of course.
>
> Oscar
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org