jaxb2-annotate-plugin

Custom annotation with jaxb2-annotate-plugin and XJC tool

巧了我就是萌 提交于 2019-12-25 03:52:29
问题 I'm trying to convert bunch of XSD files to Java source POJOs at runtime. These XML schemas will be generated based on some protocol specific model definitions. I have used the JAXB's XJC to compile the schema to pojo. Started facing problem when I used Jaxb2-annotate-plugin for doing custom annotation. For testing, I have added following in my schema, <xs:schema xmlns:aa="http://acme.example.com/system" xmlns:another="http://acme.example.com/another" xmlns:jaxb="http://java.sun.com/xml/ns

Custom annotation with jaxb2-annotate-plugin and XJC tool

痞子三分冷 提交于 2019-12-25 03:51:10
问题 I'm trying to convert bunch of XSD files to Java source POJOs at runtime. These XML schemas will be generated based on some protocol specific model definitions. I have used the JAXB's XJC to compile the schema to pojo. Started facing problem when I used Jaxb2-annotate-plugin for doing custom annotation. For testing, I have added following in my schema, <xs:schema xmlns:aa="http://acme.example.com/system" xmlns:another="http://acme.example.com/another" xmlns:jaxb="http://java.sun.com/xml/ns

Suppress compiler warnings on JAXB generated classes

我的未来我决定 提交于 2019-12-01 15:59:39
This is possibly a duplicate of this question ( Avoiding Compiler warnings on code generated by xjc ) but since I am not very well versed in XJC/JAXB custom bindings idiosyncrasies, I'll presume I may have misunderstood the mentioned question. My question seems simple enough - how can I add @SuppressWarnings("all") annotation to generated JAXB class? We have 0 warning policy on our project and after JAXB generation step, we end up with 350+ warnings which are just terrible noise. I would expect either a simple flag on the XJC or at least an easy way to provide such info but I cannot find any.

Suppress compiler warnings on JAXB generated classes

可紊 提交于 2019-12-01 14:57:38
问题 This is possibly a duplicate of this question (Avoiding Compiler warnings on code generated by xjc) but since I am not very well versed in XJC/JAXB custom bindings idiosyncrasies, I'll presume I may have misunderstood the mentioned question. My question seems simple enough - how can I add @SuppressWarnings("all") annotation to generated JAXB class? We have 0 warning policy on our project and after JAXB generation step, we end up with 350+ warnings which are just terrible noise. I would expect

JAXB schema to Java Different XmlRootElement name and Class name

限于喜欢 提交于 2019-11-29 15:06:14
I have a xsd schema from which I'm generating some java classes. I'm using jaxb for the generation. I want to be able to generate a class annotated with @XmlRootElement , but I want the @XmlRootElement name property to be different than the name of the generated class. In my xsd I'm defining the following: <xs:element name="customer"> <xs:complexType> <xs:sequence> .... </xs:sequence> </xs:complexType> </xs:element> This piece of code generates the following java class: @XmlRootElement(name = "customer") public class Customer { ... } The name property of the @XmlRootElement is the same as the

How to use jaxb2-annotate-plugin with XJC in command line

两盒软妹~` 提交于 2019-11-29 14:54:24
I'm building java classes based on an xsd using "jaxb-ri" in command line (xjc.bat). I want to set a namespace in an XmlType annotation using jaxb2-annotate_plugin but I don't know how to add this plugin to xjc classpath and acitvate it. here is my external bindings.xjb file : <jxb:bindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:annox="http://annox.dev.java.net" jxb:extensionBindingPrefixes="xjc annox" version="2.1"> <jxb:bindings schemaLocation="myschema.xsd" node="/xs:schema"> <jxb:bindings

How to use jaxb2-annotate-plugin with XJC in command line

空扰寡人 提交于 2019-11-28 09:08:47
问题 I'm building java classes based on an xsd using "jaxb-ri" in command line (xjc.bat). I want to set a namespace in an XmlType annotation using jaxb2-annotate_plugin but I don't know how to add this plugin to xjc classpath and acitvate it. here is my external bindings.xjb file : <jxb:bindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:annox="http://annox.dev.java.net" jxb:extensionBindingPrefixes=

JAXB schema to Java Different XmlRootElement name and Class name

喜夏-厌秋 提交于 2019-11-27 07:53:11
问题 I have a xsd schema from which I'm generating some java classes. I'm using jaxb for the generation. I want to be able to generate a class annotated with @XmlRootElement , but I want the @XmlRootElement name property to be different than the name of the generated class. In my xsd I'm defining the following: <xs:element name="customer"> <xs:complexType> <xs:sequence> .... </xs:sequence> </xs:complexType> </xs:element> This piece of code generates the following java class: @XmlRootElement(name =