简体   繁体   中英

SchemaGen/XJC in MyEclipse 2017 CI 10

I feel like this should be easy to find, but I haven't been able to yet. I'm using MyEclipse Enterprise Workbench 2017 CI 10 and am looking for the option that allows the creation of xml from a Java Pojo class (or vice versa). It's the MyEclipse functionality that basically wraps SchemaGen/XJC, if I understand correctly. In other versions of MyEclipse/Eclipse I was able to right click on the class and find a "Generate > ..." menu (or something close to that), but I can't seem to find that now.

Perhaps there is a plugin that is needed, but I don't remember having to do that before...

All other questions related to this seem to be not quite related or outdated.

Thanks for your time.

MyEclipse doesn't have that functionality and I'm not sure it ever has had it. Maybe you're thinking of some facilities related to web services generation (generating an xsd for types used in the service, which has a Generate context menu item) or perhaps a hibernate mapping file.

I don't know if there are other eclipse plugins that might help.

Ok, I found out the solution (with the help of some Eclipse documentation ). Here are the steps to generate an xsd from a pojo:

  1. Right click on the pojo
  2. Select New > Other
  3. JAXB folder > Schema from JAXB Classes
  4. Next
  5. Continue with the Wizard as necessary for your use case...

I think this uses schemagen under the hood actually. I misleadingly put "xjc" in the Title (although that functionality exists as well using steps 1-3 above and then selecting JAXB Classes from Schema); I will alter the title now to reflect both functionalities.

There may be a way to get the "Generate" option to come up on a right click more easily than using "New", but I wasn't able to find that. It really isn't necessary at this point since this solution works just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM