Field attribute

David Goodenough david.goodenough at linkchoose.co.uk
Sun Dec 27 08:58:51 PST 2009


You might like to look at Lombok and my Beans extension to Lombok.

Lombok can be found at http://projectlombok.org and my Beans extension
can be found at http://dga.co.uk/lombokbeans.

David

On Friday 25 December 2009, Frank Cornelis wrote:
> 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