JAXB Marshalling with null fields

后端 未结 5 1943
挽巷
挽巷 2020-12-05 04:19

This is a pretty simple request, but I just didn\'t find a way to do it.

I\'m basically trying to set up a role in JAXB which says that whenever an null field is enc

5条回答
  •  不知归路
    2020-12-05 04:49

    But but but...a empty string is not a valid lexical representation for a date, so you can't do that. i.e., if you generated an XML document with an empty value for a date field, it won't validate properly.

    In other words, if your date element has a minOccurs of 1 or more and not nillable, then you absolutely must have (1 or more) dates, which can't be null (or blanks, or other non-values).

提交回复
热议问题