从 .XSD 文件生成 Java 类...? [英] Generate Java classes from .XSD files...?

查看:35
本文介绍了从 .XSD 文件生成 Java 类...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个巨大的 QuickBooks SDK .XSD 架构文件,它定义了我可以从 QuickBooks 发送/接收的 XML 请求/响应.

I have a gigantic QuickBooks SDK .XSD schema file which defines XML requests/responses that I can send/receive from QuickBooks.

我希望能够从这些 .XSD 文件轻松生成 Java 类,然后我可以使用这些类将 XML 编组为 Java 对象,并将 Java 对象编组为 XML.

I'd like to be able to easily generate Java classes from these .XSD files, which I could then use to marshal XML to Java objects, and Java objects to XML.

有没有一种简单的方法可以做到这一点......?

Is there an easy way to do this...?

理想情况下,它在运行时不需要基本 Java 发行版之外的任何库.但我很灵活...

Ideally, it would not require any libraries external to the basic Java distro at run-time. But I'm flexible...

推荐答案

JAXB 完全符合您的要求.从 1.6 开始,它内置于 JRE/JDK 中

JAXB does EXACTLY what you want. It's built into the JRE/JDK starting at 1.6

这篇关于从 .XSD 文件生成 Java 类...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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