Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Heavily customising Getter/Setter creation?(Converting underscored_names to camelCase, 'unwrapping' objects, etc.)
icon5.gif  Heavily customising Getter/Setter creation? [message #520599] Sat, 13 March 2010 02:46
Andrew is currently offline AndrewFriend
Messages: 9
Registered: July 2009
Junior Member
I'm wondering if I can customize how Eclipse generates Getters/Setters for fields in a class.

I currently have the following issue:

The code is quite old, developed before Java Beans really became common, and as such, it doesn't adhere to the standard Java naming conventions...

So I typically have classes full of code like:

StringField column_name = new StringField(...);
NumericField column_name_two = new NumericField(...);

What I would like to do is generate Getter/Setter methods automatically, and have Eclipse convert the _'d names to camelCase names, and 'unwrap' the StringField/NumericField fields by calling the appropriate get/set method.


public String getColumnName()
    return column_name.getString();

public long getColumnNameTwo()
    return column_name_two.getNumeric();

public void setColumnName(String s)

Is this possible without writing a custom plugin for Eclipse? For what it's worth, I would like to get rid of the StringField/NumericField/etc. crap and just use Strings/ints/etc, but that would be such a large change to the codebase that we can't justify it at present Sad.

Thanks in advance all.
Previous Topic:Eclipse Errors and Warnings
Next Topic:Creating a .jar file
Goto Forum:

Current Time: Mon May 21 05:09:50 GMT 2018

Powered by FUDForum. Page generated in 0.02518 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top