JAXB默认属性值 [英] JAXB default attribute value

查看:135
本文介绍了JAXB默认属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JAXB注释从我的类生成xsd架构。

I'm using JAXB annotations to generate xsd schema from my classes.

带参数defaultValue的注释@XmlElement设置element的默认值。
是否可以为@XmlAttribute设置默认值?

Annotation @XmlElement with parameter defaultValue sets default value for element. Is it possible to set default value for @XmlAttribute?

P.S。我检查了xsd语法是否允许属性的默认值

P.S. I checked that xsd syntax allow default values for attributes

推荐答案

可能要检查一下: JAXB是否支持默认架构值?

老实说,我不知道为什么标准JAXB中没有属性默认选项。

To be honest, I don't have a clue why there isn't an attribute default option in standard JAXB.

这篇关于JAXB默认属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆