Hi

On Sat, Apr 16, 2011 at 4:40 AM, [email protected] <[email protected]>wrote:

>
>> Can you send me a pointer to some examples?
>>
>
>
>  @Path("/")
>  class WebStore {
>    @POST
>    @Path("/customers/")
>    Response addCustomer(@XmlJavaTypeAdapter(CustomerImplAdapter.class)
> Customer c) {
>      ...
>    }
>  }
>
>
>
>
>
> public class CustomerImplAdapter extends XmlAdapter<CustomerImpl, Customer>
> {
>
>        @Override
>        public Customer unmarshal(CustomerImpl v) throws Exception {
>                return v;
>        }
>
>        @Override
>        public CustomerImpl marshal(Customer v) throws Exception {
>                return (CustomerImpl) v;
>        }
> }
>
>
> ... and annotate CustomerImpl with @XmlRootElement
>
> Alternatively, instead of adding
> @XmlJavaTypeAdapter(CustomerImplAdapter.class) to the parameter, you can add
> it to Customer inteface directly.
>
>
But how can we deal here with returning not only CustomerImpl but also
AwesomeCustomerImpl ?
Usually we can rely on xsi:type but this info is not available at the
adapter level

Cheers, Sergey


> Cheers,
> Joerg
>

Reply via email to