2
应避免以下讨论。这个问题不是:JAXB绑定xs:整数到Java整数而不是BigInteger
- 使用xs:int而不是xs:integer。
- 使用原始int而不是Integer。
- 你为什么需要这个。
- 你该怎么做,如果等
问题:
我想JAXB绑定声明的例子来覆盖XS的默认映射:整数到Java的BigInteger,使xjc将生成Java Integer。
例如
<xs:attribute name="id" type="xs:integer"/>
应该产生
@XmlAttribute(name = "id")
Integer id;
,而不是
@XmlAttribute(name = "id")
BigInteger id;
如果相应的文档元素包含≥2³¹的值,您希望JAXB做什么? – VGR
没有太担心。 –
这有没有答案?我发现它使用谷歌。 –