Tôi có xsd sau:jaxb không tạo ra sự đếm với cơ sở nguyên
<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 chỉ không có gì, không có lỗi, không có cảnh báo chỉ không tạo ra lớp này. Nếu thay đổi cơ sở từ xs:integer
thành xs:string
thì sẽ ổn. Nhưng tôi cần chính xác giá trị số nguyên.
tôi tạo ra các lớp học với 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>
Và câu hỏi 2. JAX-B và IDE (IDEA) không cho phép khoảng trắng trong id attrribute. Tại sao?
<xs:enumeration value="0" id="Approved_no_error">
- ok
<xs:enumeration value="0" id="Approved no error">
- không ok
Có hành vi có đúng không?
chết tiệt. 'code' ( xs: chú thích> 'code' xs: chú thích> xs: enumeration>) 'code' –
cách sử dụng thẻ trong các nhận xét –
Tài liệu tốt cho mục đích: https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/Developing_Applications_Using_JAX-WS/files/JAXWSCustomTypeMappingEnum.html –