JAXB, Custom bindings, Adapter1.class and Joda-time

前端 未结 7 1674
时光说笑
时光说笑 2021-01-11 15:38

I have a problem with the way JAXB is generating the bound classes for an XML schema (which, for sake of precision, I cannot modify). I want to map a xsd:date type to a Joda

7条回答
  •  青春惊慌失措
    2021-01-11 15:48

    You are extending XmlAdapter which is used when you want to annotation your Java model for JaxB, that is through the annotation @XmlJavaTypeAdapter(Adapter1.class). For your case you just need a class with static methods that does not extend XmlAdapter. You will need the parse method (take a string and return date) and print method (take a date and return a string) and that's about it.

提交回复
热议问题