Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9093025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:59:02+00:00 2026-06-16T22:59:02+00:00

I have a small question regarding generated getter and setter methods in my domain

  • 0

I have a small question regarding generated getter and setter methods in my domain objects.
I want to use a common style guide for my source code. One part of that style guide says that I start each class member name with the prefix ‘m’ for member.

class User{
String mName;
List<Call> mAllCall;
List<Geo> mAllGeo;

Unfortunately I have a couple of classes with many more member variables. The problem I have is that I am a very lazy developer, and that I create the getter and setter methods in Eclipse with

“Source”->”Generate Getters and Setters”.

The result is

public String getmName() {
    return mName;
}
public void setmName(String mName) {
    this.mName = mName;
}
public List<Call> getmAllCall() {
    return mAllCall;
}
public void setmAllCall(List<Call> mAllCall) {
    this.mAllCall = mAllCall;
}
public List<Geo> getAllGeo() {
    return mAllGeo;
}
public void setmAllGeo(List<Geo> mAllGeo) {
    this.mAllGeo = mAllGeo;
}

That is not the result I want. I need this:

public String getName() {
    return mName;
}
public void setName(String pName) {
    this.mName = pName;
}
public List<Call> getAllCall() {
    return mAllCall;
}
public void setAllCall(List<Call> pAllCall) {
    this.mAllCall = pAllCall;
}
public List<Geo> getAllGeo() {
    return mAllGeo;
}
public void setmAllGeo(List<Geo> pAllGeo) {
    this.mAllGeo = mAllGeo;
}

I currently remove and replace the prefix in the method names by hand. Is there an easier way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T22:59:04+00:00Added an answer on June 16, 2026 at 10:59 pm

    For the prefix m, you add the letter m to your list of prefixes in the Java Code Style.

    Follow these steps:

    1. open Preferences,
    2. in left panel, expand Java,
    3. expand Code Style,
    4. right panel is where you should now be looking at

    You will see a list with Fields, Static Fields, etc. This is what you need to modify.

    Set m against Fields.

    Set p against the Parameter.

    As the name of the field will now be different from the name of the argument, the this. qualification will no longer be added automatically. However, you can check the option Qualify all generated field accesses with ‘this.’ to have it again.

    I suppose that you know the difference between Enable project specific settings and Configure Workspace Settings… in the upper left and right of the window?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just a small question regarding joins. I have a table with around 30 fields
I have a small question regarding rails. I have a search controller which searches
I have a simple, general question regarding a real small issue that bothers me:
Possible Duplicate: void * arithmetic Hi guys I have a small question regarding pointer
I have small question regarding the following error: this.context.sourceCache On a custom control I
Inspiring from a obfuscated piece of code, I have a small question regarding to
I want to put a question about what ideas do you have regarding Open
just a small question regarding the php session handler, let's say i want to
I'm writing a small webapp in Grails and I have the following question regarding
I have a small question regarding a Hash Table. Suppose i have a String

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.