0

Is there a better way to create a "code template" for Eclipse that generates at the same time the property and getter/setter?

I can't find any way to camel the property name in the setter and getter code

private ${propertyType} ${propertyName};
public ${propertyType} get${PropertyName} ()
{   
    return ${propertyName};
}
public void set${PropertyName} (${propertyType} ${propertyName})
{
    this.${propertyName} = ${propertyName};
}

Is there any well done code repository on the web?

Any "code template" reference?

  • 2
    Why can't you just use the [built in function?](http://stackoverflow.com/questions/7221691/is-there-a-way-to-automatically-generate-getters-and-setters-in-eclipse) – chancea Jan 30 '15 at 15:59
  • 2
    Ask **one** question per question. *"Is there any well done code repository on the web?"* would be **way** to broad a question for SO. – T.J. Crowder Jan 30 '15 at 16:01
  • What exactly do you mean by, "camel the property name"? – nitind Jan 30 '15 at 16:18
  • @nitind The property is named "foo", but the methods need to capitalize it to get "getFoo". He meant camelCase the method name. – Ingo Bürk Jan 30 '15 at 16:20
  • @chancea the builtin function is very useful in a post production context when you want to create set and getter for a lot of parameters, "code template" is useful when you are writing code on the fly. Please notice that the camelCase problem (thank @IngoBürk) will occur to solve a lot of other powerful templates – Simone Buzzi Jan 31 '15 at 14:24

0 Answers0