Generate XML Schema from Java class (or the opposite)

后端 未结 3 1971
我在风中等你
我在风中等你 2021-02-10 03:12

I wanted to generate some XML Schemas for my project. I have some Java Classes, like this one:

package com.fortresswars.entity;

import com.fortresswars.entity.p         


        
相关标签:
3条回答
  • 2021-02-10 03:58

    Yes, JAXB can go both ways (using annotations). Check out this question for more info and some links.

    0 讨论(0)
  • 2021-02-10 04:05

    There's a tool called schemagen inside the JDK bin directory, that turns java source/class file into an XML schema. See the documentation.

    0 讨论(0)
  • 2021-02-10 04:13

    JAXB can do both

    1. Using JAXB schemagen tooling to generate an XML schema file from a Java class
    2. Using JAXB xjc tooling to generate JAXB classes from an XML schema file
    0 讨论(0)
提交回复
热议问题