Jason-
In general Castor will determine the class of an object automatically
and map it based on the mapping for the given class. If Castor
doesn't think there is enough information in the mapping file to
instantiate the correct object during unmarshalling, it will add an
xsi:type attribute to the xml element to help out the Unmarshaller
(i.e. xsi:type="java:java.lang.String" or xsi:type="java:foo.Bar").
So in general I would say just try it. If you run into some problems,
feel free to ask further questions.
HTH,
Stephen
On 3/15/06, Jason Wood <[EMAIL PROTECTED]> wrote:
>
>
>
> How do I define within a mapping file the different types of object a
> collection member can hold?
>
>
>
> So I haveā¦.
>
>
>
> Class myClass {
>
> private ArrayList mylist = new ArrayList();
>
> public void add(Object obj) {
>
> myList.add(obj);
>
> }
>
> }
>
>
>
> myClass my = new myClass();
>
> my.add(new String("Hello"));
>
> my.add(new Integer(1));
>
> my.add(new SomeOfObject());
>
>
>
>
>
> How do I tell Castor to us the correct mapping class for each?
>
>
>
> J