xjc

XJC - is it extensible?

ぐ巨炮叔叔 提交于 2019-12-12 16:20:11
问题 This question is related to JAXB2 type restriction not working?. I want to extend XJC to support type restrictions. It would be as simple as overriding super class' field definitions. Is there any way to do that properly? Any hooks? Any similar tools? 回答1: Yes , XJC is extensible with plugins: What can a plugin do? A JAXB RI plugin participates in the code generation from a schema. It can define its own customizations that users can use to control it, it can access the code that the JAXB RI

JAXB XJC Two declarations cause a collision. Customized binding cannot be honored

我是研究僧i 提交于 2019-12-12 14:17:13
问题 I would like to generate JAXB classes from this schema file: http://www.taxonx.org/schema/v1/taxonx1.xsd I resolved a couple of naming collisions caused by the imported mods-3-1.xsd using customized bindings as follows: <jxb:bindings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" version="2.1"> <jxb:bindings schemaLocation="http://www.loc.gov/standards/mods/v3/mods-3-1.xsd"> <jxb:bindings node="//xsd:complexType[@name='relatedItemType']/xsd:attribute[

JAXB english comments in generated file

久未见 提交于 2019-12-12 11:35:53
问题 I use XJC to compile some XSD to Java classes. On my machine, instead of the usual comment // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 I get the same comment but in italian // Questo file è stato generato dall'architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.11 XJC is invoked with Maven plugin maven-jaxb2-plugin:0.12.0:generate . Same pom generates different comments on different machines. How do I

Applying external JAXB binding file to schema elements imported from WSDL

无人久伴 提交于 2019-12-12 09:34:28
问题 The XPath expression in my external binding files can't target the elements in my XML schemas which are imported into my WSDL. Everything runs if I do inline binding customization but I really wanted to have external binding files that way I never accidentally overwrite(refresh) the files containing my customizations. The start of my binding file: <jaxb:bindings xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001

Use JAXB (xjc) generated classes in android

て烟熏妆下的殇ゞ 提交于 2019-12-12 07:57:15
问题 I am using a Rest-Webservice in Android . The Web Service could handle JSON and XML , the API is described as an XSD . So I used JAXB to generate classes from the XSD and then I used jackson JSON processor to generate JSON from my instances. The problem is, that JAXB ( xjc ) generates classes with JAXB annotations and Android can't handle those. I tried to add the jaxb-api.jar to my android project but the Dalvik won't use core classes. For my first implementation I manually removed the

JAXB / XJC: Generate classes from elements with same complexType

时光总嘲笑我的痴心妄想 提交于 2019-12-12 05:26:50
问题 I would like to generate the Java classes SignResponse and AuthResponse from the following XSD using XJC: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="SignResponse" type="tns:OrderResponseType"/> <xsd:element name="AuthResponse" type="tns:OrderResponseType"/> <xsd:complexType name="OrderResponseType"> <xsd:sequence> <xsd:element name="orderRef" type="xsd:string"/> <xsd:element name="autoStartToken" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd

wrapper class missing when using xjc on xsd

a 夏天 提交于 2019-12-12 03:25:38
问题 i have the following XSD: <xsd:element name="products" > <xsd:complexType> <xsd:sequence> <xsd:element name="product" type="foo:myProduct" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType> </xsd:element> Now when i issue XJC, it doesnt generate a Products.class file but only the Product.class. But of course my XML looks like this: <products> <product>...</product> <product>...</product> </products> So at the end, i dont have a class with XmlRootElement annotation, which is odd. Of

Error while parsing xsd using xjc

白昼怎懂夜的黑 提交于 2019-12-12 01:13:36
问题 I am parsing following xsd using xjc <?xml version="1.0" encoding="utf-8"?> <xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="Response"> <xsd:complexType> <xsd:sequence> <xsd:element name="Content"> <xsd:complexType> <xsd:sequence> <xsd:element name="Content1"> <xsd:complexType> <xsd:sequence> <xsd:element name="Type" type="xsd:string" /> <xsd:element name="ID" type="xsd:string" /> <xsd

xjc fails on imported schema when using episodes due to property customization

怎甘沉沦 提交于 2019-12-11 17:21:13
问题 I have two schemas a.xsd and b.xsd . b imports a . On one element, a customizes the JAXB compilation. a.xsd: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" targetNamespace="a" xmlns:a="a" jaxb:version="2.0" elementFormDefault="qualified"> <xsd:element name="a" type="a:A1Type"/> <xsd:complexType name="A1Type"> <xsd:sequence> <xsd:element name="a" type="xsd:string"> <xsd:annotation> <xsd:appinfo> <jaxb:property name="a0"></jaxb:property> <

jaxb2 simplify plugin binding issue

醉酒当歌 提交于 2019-12-11 11:56:07
问题 I tried to use JAXB2 simplify plugin using the XJC 2.2.4. D:\>xjc -d . -extension -p org.my.space sample.xsd parsing a schema... [ERROR] Unsupported binding namespace "http://jaxb2-commons.dev.java.net/basic/simplify". Perhaps you meant "http://jaxb.dev.java.net/plugin/code-injector"? line 7 of file:/D:/sample.xsd Failed to parse a schema. sample.xsd has the declared simplify <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.1"