Field attribute
Frank Cornelis
info at frankcornelis.be
Thu Dec 24 21:33:16 PST 2009
Hi,
Here is an idea for a Java language extension. As JBoss Seam user I
frequently do something like:
@DataModel
private List<MyEntity> entities;
@Factory("entities");
public void initEntities() {
this.entities = ...
}
If I refactor this code and rename the entities field, my factory method
won't work anymore as it has to refer to the entities field name. So my
suggestion would be to introduce a syntax as follows:
@DataModel
private List<MyEntity> entities;
@Factory(@this.entity.getName())
public void initEntities() {
this.entities = ...
}
So the @this.entities gives you the Field class of the this.entities
variable.
Kind Regards,
Frank.
More information about the coin-dev
mailing list