If "MyList" is a List, the easiest is to jst add a method:
public List<Item> getItems() {
return items;
}
and move the JAXB annotations onto it instead of the field. The
runtime will use that method to get the list. It will use that to
call list.add(..) to populate it or the iterator to write it. You
could actually return an object that implements List that wrappers
your real object.
If it DOESN'T implement the list, you'll need to write an
XmlJavaTypeAdapter that maps your type to/from the appropriate List.
The java_frist_jaxws sample shows one of those for mapping Maps.
Dan
On Jul 22, 2008, at 4:19 PM, Kugaprakash Visagamani wrote:
Hi,
In the WSDL definition, I have a list of items as given below:
Wsdl2Java converted java object sample is given below:
Public class Order {
Private List<Item> items;
}
But my actual model class definition is:
Public class Order{
Private MyList items; //MyList is my own implementation of List,
or may be it may not even be extending from the java.util.List, is
rather kind of implementation of list
}
Note: I am not planning to use the Wsdl2Java generated java objects,
instead I am placing my actual model class "Order" in the same package
as the Wsdl2Java generated java objects would be, so that during
searialization/de-serialization process, it actually pick my actual
model class. It all works fine, except for this kind of scenarios,
where
I have my own implementation of List.
Can I add some interceptor or define somewhere in the xml's that
during
the marshall/unmarshall if it encounter's List, use my implementation
instead.
Any sample code would be HIGHLY Appreciated.
Thanks in advance.
Best Regards,
Kuga
---
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog