JAXB Marshalling and Generics

后端 未结 5 1048
天涯浪人
天涯浪人 2020-12-17 19:29

I am trying to use JAXB\'s introspection to marshall and unmashall some existing domain objects marked up with JAXB annotations. Most things work as expected, but I am havin

5条回答
  •  青春惊慌失措
    2020-12-17 19:58

    Actually, it is not quite clear to me why this would not work. It seems like JAXB should be able to resolve specific subtype correctly: if (and only if!) this type is NOT the root type (which it is not as per your description). I mean, it is just a Bean; so if bean with T replaced with direct type works, so should generic version iff using sub-classing to bind types (as is done in example).

    So perhaps it could be a bug in implementation?

提交回复
热议问题