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

前端 未结 7 1675
时光说笑
时光说笑 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:54

    When generating XmlAdapters from an XML schema you need to put the logic for the conversion in static methods not in an XmlAdapter. This is so an XmlAdapter that leverages that logic can be generated. I recognize that this is an odd mechanism.

    Complete Example

    • http://blog.bdoughan.com/2011/08/xml-schema-to-java-generating.html

提交回复
热议问题