This is becoming a FAQ - see the thread http://www.mail-archive.com/jibx-users%40lists.sourceforge.net/msg01660.html

- Dennis

Stephan Rossouw wrote:

Hi there,

I have a problem. Right now I have an interface called Payment and then a few different implementations of it like CashPayment, CreditCardPayment…

In my xml I have a payment element which has an attribute called “type”. Is there a way I can test what is in the attribute and Marshall it accordingly? In this example I need to end-up with an Iterable that contains two Payments, one being a CashPayment and the other a CreditCardPayment.

public class Request{

private Iterable<Payment> __payments;

…

}

public interface Payment{

…

}

<request>

<payment type=”Cash”>

…

</payment>

<payment type=”CreditCard”>

…

</payment>

</request>

Is it possible to write custom marshallers to do this or should I use a different way of doing this?



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to