IntelliJ IDEA 2016.2 Help

Generating Xml Schema From Java Code

This topic describes how to have an XML Schema generated on the basis of a Java class, which involves mapping the members of the Java class to the elements of the XML Schema. With IntelliJ IDEA, this transformation can be done using the JAXB.

To generate an XML Schema from a Java class using JAXB

  1. Open the Generate XML Schema From Java Using JAXB dialog box by doing one of the following:
    • In the Project tool window, select the name of the desired class and choose Web Services | Generate XML Schema From Java Using JAXB on the context menu.
    • With the desired class opened in the active editor tab, choose Tools | JAXB | Generate XML Schema From Java Using JAXB on the main menu.
  2. Specify the method parameter and return types to be reflected in the generated Schema:
    • To have all the class methods involved, clear the Include parameter and return type of the following methods check box.
    • To select specific methods to be involved, select the Include parameter and return type of the following methods check box, then select the Add to JAXB generation check box next to the desired methods.

See Also

Last modified: 23 November 2016