> 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.
G