I think you may have misinterpreted my last answer, Clovis. If you use your own subclass of Vector, say MyVector, and define a <mapping> for that subclass, then you can use it in a generic Object reference like:

public class Operation {
  public String action;
  public Object object;
}

where the object field can contain any type of mapped class instance (including an instance of MyVector).

 - Dennis

Clovis Wichoski wrote:

Ok,
But how to map a generic class, since in the object attribute maybe
contain a "Vector" or one of any mapped object, for all cases I must
have a commom interface or base class? then all my classes must
implements or extend this.
Only a tip or for a new feature, for what I wish to achieve with JiBX,
if the field of a mapped class is of type java.lang.Object then the
value must be any mapped Object or any of java.util.Collection of any
mapped Objects, for example if the instance of object attribute is a
Vector, then the marshalled XML can be like this:.
<operation action="load">
   <object>
       <vector size="3">
           <myObject1 oid="AAAAAZXY" name="test1" />
           <myObject2 oid="AAAAAWXY" name="test2" />
           <myObject1 oid="AAAAAZXZ" name="test3" />
       </vector>
   </object>
</operation>

then if the instance of object attribute is a mapped object:
<operation action="load">
   <object>
       <myObject1 oid="AAAAAZXY" name="test1" />
   </object>
</operation>

Thanks

Clovis

On 7/10/05, Dennis Sosnoski <[EMAIL PROTECTED]> wrote:
Hi Clovis,

There's no way to handle this directly in exactly the way you've
specified it, since JiBX can't define a full (non-abstract) <mapping>
for java.* classes like Vector. If you are able to change the code
slightly you can get around this limitation by defining your own
subclass of Vector:

public class MyVector extends Vector {}

Then you can define a <mapping> for MyVector and you should be good to go.

 - Dennis

Clovis Wichoski wrote:

Hi,

having the class:

public class Operation {
 public String action;
 public Object object;
}

the object attribute, can be any type of mapped Object, or can have a
java.util.Vector that contains many types of mapped Objects, there is
a way to map this Operation class using JiBX?


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users



-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to