pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: Component names inside the containers
Date Mon, 07 Jun 2010 17:40:20 GMT
> I was just about to write a mail that suggests just that. Add a getName()/setName() pair
to Component, that's it. (In fact that's just what I suggested a month ago... ;-)

It is? Huh - I either don't remember or completely misunderstood your suggestion.  ;-)

> Further more, it would be inappropriate to add something like this to BeanSerializer:
> if (wtkxId != null && object instanceof Component)
>  ((Component)object).setName(wtkxId);
> Instead I suggest that you look for an annotation on the object's class, say @Id or @WtkxId
or something like that:
> @WtkxId("name")
> public class Component {
>  ...
>  public String getName() {...}
>  public void setName(String name) {...}
> }
> That way, other classes could get their id injected, too, for whatever reasons.

We don't actually need an annotation for this. Simply adding the getter and setter is sufficient
to support the "name" attribute.


View raw message