Marshaling a long primitive type using JAXB

前端 未结 4 1892
小鲜肉
小鲜肉 2021-01-18 10:08

To marshal a long primitive type using JAXB, I have used @XmlJavaTypeAdapter annotation, which will adapt non-String type to a String. Even though it throw erro

4条回答
  •  鱼传尺愫
    2021-01-18 11:02

    Specify the primitive class in the annotation:

    @XmlJavaTypeAdapter(type=long.class, value=WSLongAdapter.class)
    

提交回复
热议问题