如何在IntelliJ IDEA 13中创建JAXB项目? [英] How to create a JAXB project in IntelliJ IDEA 13?

查看:592
本文介绍了如何在IntelliJ IDEA 13中创建JAXB项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习JAXB。
我需要知道如何在IntelliJ IDEA13中为JAX-B创建一个简单的java项目。如果有人有想法,请更新我,并使用任何IDEA插件更新我

I am learning JAXB. I need to know how should I create a simple java project for JAX-B in IntelliJ IDEA13. If anyone have idea, please update me and also update me with any plugin for IDEA

谢谢。

推荐答案

创建项目时不需要做任何特殊操作。 只需要一个简单的java项目。

You don't need to do anything special when you create your project. Just a simple java project will do.

但是有一些技巧可以帮到你。 jaxb有2个内置实时模板

There are however some tricks that can help you. There are 2 built-in live templates for jaxb :


  1. 输入 mjo + hit tab-key:将为编组人员生成代码。

  2. 输入 ujo +点击tab-key :将为unmarshaller生成代码。

  1. typing mjo + hit tab-key: will generate the code for a marshaller.
  2. typing ujo + hit tab-key: will generate the code for an unmarshaller.

Intellij具有生成的内置功能任何 xml 文件的xsd 文件。只需右键单击任何 xsd 文件,您将看到一个按钮从xml文件生成xsd架构

Intellij has built-in functionality for generating an xsd file for any xml file. Just right-click on any xsd file and you will see a button "Generate xsd schema from xml file".

JAXB还提供了一个工具( xjc.exe )来生成JAXB代码存根。有一种简单的方法可以将此功能添加到IntelliJ。我更喜欢使用中的配置将 xsd 的按钮添加到java源代码转换外部工具菜单。

JAXB also offers a tool (xjc.exe) to generate JAXB code stubs. There is a simple way to add this functionality to IntelliJ. I prefer to add a button for xsd to java source conversion, using the configuration in the "External Tools" menu.

完成此配置后,您可以右键单击xsd文件,会出现一个按钮JAXB(XSD-> JAVA)

After this configuration, you can right-click on an xsd file and there will be a button "JAXB (XSD->JAVA)".

注意:根据一些网站,还有一个用于生成jaxb存根的对话框/向导。但是,我还没有找到这个向导。也许它仅适用于最近的IntelliJ版本(14+),可能仅在商业版中,或者可能需要一些插件。 我的解决方案在IntelliJ 13.0.3 - 社区版中运行良好。

Note: According to some websites, there is also a dialog/wizard for generating jaxb stubs. However, I haven't found this wizard yet. Maybe it's only available in more recent IntelliJ versions (14+), maybe only in the commercial edition, or it may require some plugins. My solution works fine in IntelliJ 13.0.3 - Community Edition.

这篇关于如何在IntelliJ IDEA 13中创建JAXB项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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