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?

 

Reply via email to