我有以下 xsd:
<xs:simpleType name="resultcode">
<xs:restriction base="xs:integer">
<xs:enumeration value="0" id="Approved_no_error">
<xs:annotation>
<xs:appinfo>
<jxb:typesafeEnumMember name="Approved_no_error"/>
</xs:appinfo>
</xs:annotation>
</xs:enumeration>
JAX-B 什么都不做,没有错误,没有警告,只是不会生成这个类.如果将基数从 xs:integer 更改为 xs:string 就可以了.但我需要的正是整数值.
JAX-B just does nothing, no errors, no warnings just doesn't generate this class. If change base from xs:integer to xs:string then it's ok. But I need exactly integer values.
我用 maven 生成类:
I generate classes with maven:
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>AuthGateway</id>
<goals>
<goal>xjc</goal>
</goals>
问题 2.JAX-B 和 IDE (IDEA) 不允许在 id 属性中使用空格.为什么?
And question 2. JAX-B and IDE (IDEA) doesn't allow whitespaces in id attrribute. Why?
<xs:enumeration value="0" id="Approved_no_error"> - 好的<xs:enumeration value="0" id="Approved no error"> - 不行
这是正确的行为吗?
您可以使用外部绑定文件来获取您正在寻找的行为:
You can use an external binding file to get the behaviour that you are looking for:
这篇关于jaxb 不生成具有基本整数的枚举的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何在 JTextPane 中的组件周围环绕文本?How to wrap text around components in a JTextPane?(如何在 JTextPane 中的组件周围环绕文本?)
MyBatis,如何获取插入的自动生成密钥?[MySql]MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何获取插入的自动生成密钥?[MySql])
在 Java 中插入 Oracle 嵌套表Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java:如何将 CLOB 插入 oracle 数据库Java: How to insert CLOB into oracle database(Java:如何将 CLOB 插入 oracle 数据库)
为什么 Spring-data-jdbc 不保存我的 Car 对象?Why does Spring-data-jdbc not save my Car object?(为什么 Spring-data-jdbc 不保存我的 Car 对象?)
使用线程逐块处理文件Use threading to process file chunk by chunk(使用线程逐块处理文件)