users@jersey.java.net

[Jersey] Re: Unmarshalling generic type using Jersey JSON

From: Marek Potociar <marek.potociar_at_oracle.com>
Date: Mon, 15 Aug 2016 11:06:41 +0200

Hello Hannes,

Generics are generally screwed in Java. I would suggest to wrap your generic content into a wrapper data POJO and work with that POJO. Maybe not ideal, but certainly simplest and least error-prone solution to your problem.

Marek

> On 10 Aug 2016, at 15:01, Hannes Hofmann <hannes.hofmann92_at_gmail.com> wrote:
>
> Hello together,
>
> I am currently using Jersey JSON to marshal and unmarshal objects and facing a problem when I want to unmarshall an object with a generic type.
> Detailed information can be found here: http://stackoverflow.com/questions/38752940/jersey-json-unmarshalling-generic-typed-class <http://stackoverflow.com/questions/38752940/jersey-json-unmarshalling-generic-typed-class>
>
> 1. Is it possible to unmarshal an object that contains a generic type?
> 2. If yes, how..?
>
>
> Thanks,
> Hannes