Hi there,

 

I also faced a similar issue. I ended up writing a custom marshaller and
unmarshaller since I couldn't find an inbuilt solution in Jibx for this.


 

Mahen

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of gufux
Sent: 25 June 2008 09:36
To: [email protected]
Subject: [jibx-users] Subclasses if an inside element is different

 

Hi,

I have an issue with binding and class inheritance based on an internal
element of XML schema. I have the following classes:

----------------------------------------------------------

public class Profile {
    protected UniqueId profileId;
}

public class Traveller extends Profile {
    protected TravellerName name;
    ....
}

public class Company extends Profile {
   protected CompanyName name;
   ....
}
------------------------------------------------------------

and XML messages like that:

1) <Profile>
      <UniqueId type="1" />
       <TravellerName>Davide</TravellerName>
   </Profile>
2) <Profile>
      <UniqueId type="1" />
       <CompanyName>IBM</ComapnyName>
   </Profile>

So I want to use only instances of Traveller and Company depending if in
XML inside the <Profile> i have <TravellerName> or <CompanyName>.
I've tried with abstract classes and "extends" but there isn't a
solution because when JibX have to bind the <Profile> it doesn't know
the inside element and the correct
instance depend on that element.

I'have spent many time on this problem and so I would know if it's me
that haven't found the right solution or in fact in Jibx simply I can't
do that... anyone have any suggestions?

Thanks

Davide.

The information contained in this email is strictly confidential and for the 
use of the addressee only, unless otherwise indicated. If you are not the 
intended recipient, please do not read, copy, use or disclose to others this 
message or any attachment. Please also notify the sender by replying to this 
email or by telephone (+44 (0)20 7896 0011) and then delete the email and any 
copies of it. Opinions, conclusions (etc.) that do not relate to the official 
business of this company shall be understood as neither given nor endorsed by 
it. IG Index plc is a company registered in England and Wales under number 
01190902. VAT registration number 761 2978 07. Registered Office: Friars House, 
157-168 Blackfriars Road, London SE1 8EZ. Authorised and regulated by the 
Financial Services Authority. FSA Register number 114059.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to