users@jaxb.java.net

Re: xjc plugin problem

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Mon, 21 May 2007 10:06:18 +0200

Hi.

annother way:
> setMethodblock.assign(JExpr._this().ref(idFieldVar ), var);



These are two different approaches. Depends on if you:

a) want to add the "id" property mapped to anything in your document;
b) simply want to add the "id" field/getter/setter.

I described the first approach. You were implementing the second one.
The difference between these two is that in the first case the property is
added into the XJC "model". Therefore it will be available to other plugins.
For instance, if you additionally generate equals() or hashCode() methods,
your property will not be considered since it's not the part of the XJC
model. Mine will.

Ok, so the wrap-up is:

* If you really want a new property in the model, use a).
* If you just need few more methods, use b).

Bye.
/lexi