xjc

JAXB-XJC Xpropertyaccessors

霸气de小男生 提交于 2019-12-24 04:14:17
问题 Per JAXB specification http://jaxb.java.net/2.2.4/docs/xjc.html if you want to run the JAXB-XJC compiler, one of the of the extensions/arguments you may pass is -Xpropertyaccessors even though it has been specfied in each of JAXB-RI till the latest one 2.2.5u2 still when I try to run it passing this argument I get 'unrecognized parameter -Xpropertyaccessors' is not specified in the help menu when I run it. It is important for me to have the access levels on properties not fields. 回答1: I have

xjc binding customization does not work in jaxb 2.1.3. It works in jaxb 2.0

女生的网名这么多〃 提交于 2019-12-24 01:37:58
问题 I developed a binding customization file in jaxb 2.0 in JDK 1.6.0 and it worked fine. Now I'm using jaxb 2.1.3 in JDK 1.6.0_13 and it gives me errors: Error xxx shows up in more than one properties which is what the binding file is suppose to be handling by renaming them. What happened between 2.0 and 2.1.3 that I need be aware of and what do I need to change. I've searched near and far and can't figure it out. Thanks so much for your help. I'm using the binding customization file because the

How to specify multiple binding files in gradle for ant xjc task

拥有回忆 提交于 2019-12-23 15:27:59
问题 I have multiple bindings(xjb files) in the gradle project. When generating JAXB classes for a xsd(C.xsd). I want to use the previously generated binding files for A.xjb & B.xjb since C.xsd refers to A.xsd & B.xsd The below ant xjc task works if I don't have anyother bindings in same path but I want specify explicity A.xjb & B.xjb bindings. How to go about same, I tried various options but nothing seems working. Any help greatly appreciated. ant.xjc(destdir : '${jaxbDest}', removeOldOutput:

java.net.MalformedURLException: no protocol

女生的网名这么多〃 提交于 2019-12-23 07:45:48
问题 I' m writing a class to run xjc in java. my code goes as follows: URL url = new URL("C:\\Users\\Simran\\Desktop\\books.xsd"); SchemaCompiler sc = XJC.createSchemaCompiler(); sc.parseSchema(new InputSource(url.toExternalForm())); S2JJAXBModel model = sc.bind(); JCodeModel cm = model.generateCode(null, null); cm.build(new FileCodeWriter(new File("C:\\Users\\Simran\\Desktop\\books.xsd"))); however I get the following error when I run this: Exception in thread "main" java.net

Use JAXWS enableWrapperStyle while generating Java source with XJC

我是研究僧i 提交于 2019-12-23 02:38:31
问题 I'm trying to generate Java source from XSD and have to disable wrapper style with JAXWS. I've written the custom binding but it seems that JAXWS doesn't work with XJC. The binding I use is pretty simple. <jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xmlns="http://java.sun.com/xml/ns/jaxws" version="2.1" jaxb:extensionBindingPrefixes="xjc">

How to override the default name for in JAXB using a external binding file?

孤街醉人 提交于 2019-12-22 08:54:44
问题 I have an element that looks something like this. <xsd:element name="container"> <xsd:complexType> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:element ref="navmap"/> <xsd:element ref="keymap" /> <xsd:element ref="container" /> <xsd:element ref="ad" /> <xsd:element ref="button" /> <xsd:element ref="checkbox" /> </xsd:choice> </xsd:complexType> </xsd:element> Here is the default code that gets created for this element. @XmlElements({ @XmlElement(name = "navmap", type = Navmap.class),

How to override the default name for in JAXB using a external binding file?

坚强是说给别人听的谎言 提交于 2019-12-22 08:54:12
问题 I have an element that looks something like this. <xsd:element name="container"> <xsd:complexType> <xsd:choice minOccurs="0" maxOccurs="unbounded"> <xsd:element ref="navmap"/> <xsd:element ref="keymap" /> <xsd:element ref="container" /> <xsd:element ref="ad" /> <xsd:element ref="button" /> <xsd:element ref="checkbox" /> </xsd:choice> </xsd:complexType> </xsd:element> Here is the default code that gets created for this element. @XmlElements({ @XmlElement(name = "navmap", type = Navmap.class),

Generate java classes from a wsdl url with basic authentication

爱⌒轻易说出口 提交于 2019-12-22 08:08:44
问题 I am trying to generate the java classes from a WSLD file, that uses basic authentication. Although there are many plugins out there, I have to use the following one: org.jvnet.jaxb2.maven2:maven-jaxb2-plugin With wsimport or wsdl2java i have found the way to configure the basic authentication parameters. Using the maven-jaxb2-plugin i had no luck. My configuration follows: <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>0.13.2</version>

JAXB XJC code generation of element initializers with their declaration

泄露秘密 提交于 2019-12-22 05:06:57
问题 If I have a schema such as the following: <xs:element name="Book"> <xs:complexType> <xs:sequence> <xs:element ref="Chapter" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Chapter"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" name="Word" /> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Word"> </xs:element> It will generate something like: @XmlRootElement(name = "Book") public class Book { @XmlElement(name = "Chapter", required = true

How to write my XSD in order to match the desired XML and Java format using JAXB and XJC [duplicate]

老子叫甜甜 提交于 2019-12-21 22:17:22
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How generate XMLElementWrapper annotation with xjc and customized binding I would like to be able to process XML of this format using JAXB ... <configuration> <!-- more content here --> <things> <thing> <name>xx1</name> <value>yy1</value> </thing> <thing> <name>xx2</name> <value>yy2</value> </thing> </things> <!-- more content here --> </configuration> I'd like to marshal the above XML into these Java classes