Questions tagged [xjc]

XJC is a JAXB tool for compiling XSD (XML Schema) to Java source code.

XJC is a JAXB tool for compiling XSD (XML Schema) to Java source code.

687 questions
0
votes
1 answer

maven-jaxb2-plugin: how to accomplish this xjc command-line in the pom.xml?

Because of various issues with the XSDs I need to compile (described in other SO posts), I have a bindings file and also a local extension schema. The following command line works correctly, but I'm having trouble figuring out the right pom.xml…
denishaskin
  • 2,855
  • 3
  • 19
  • 33
0
votes
1 answer

XJC: Generate subpackages for complexTypes

is it Possible to generate extra subpackages per complexType when generating Javaclasses with XJC2Task? I have a problem generating from a xsd where i have a complexType named Traveller which has an element named "ElementNumber". But also a single…
sti
  • 13
  • 3
0
votes
1 answer

XJC re-use classes across ant tasks

I am exploring options to use same classes across two different ant tasks. In the first task, I am already building the jar & deleting the generated classes. Xjc does not allow passing a jar as a parameter for reference. One option that I currently…
kiran reddy
  • 85
  • 14
0
votes
1 answer

How to generate @XmlSchemaType for an element customized with xjc:javaType

I would like to use xjc to generate JAXB objects while using an XmlJavaTypeAdapter I'm currently using the following in global bindings:
indybee
  • 393
  • 3
  • 10
0
votes
1 answer

How to generate immutable Java objects using XJC?

Since I switch to Java 8 I start using 'parallelStream' on collections. I want to generate immutable Java objects to have 100% conviction that state of paralelly procesed object is/was not change.
Karol Król
  • 2,844
  • 1
  • 29
  • 36
0
votes
1 answer

How to re-use jaxb bindings for multiple xsds?

I'm trying to figure out a way for how to use the same .xjb bindings file for multiple xsd files. I found a solution here for "floating global bindings": https://www.java.net/node/674443 However, the stuff I'm trying to do does not seem to be…
mac
  • 2,214
  • 3
  • 25
  • 38
0
votes
1 answer

xjc handle duplicated elemements

I have three XSD files: a.xsd, b.xsd and c.xsd Each of them contains an xs:element called MyHeader I try to use xjc to generate java classes from these three XSD file Error when generating the java file Here is the common part in all three…
yjasrc
  • 465
  • 1
  • 4
  • 15
0
votes
1 answer

how can i add binding.xml to Dynamically generated java sources (without xjc)

my code is: import com.sun.codemodel.JCodeModel; import com.sun.tools.xjc.api.S2JJAXBModel; import com.sun.tools.xjc.api.SchemaCompiler; import com.sun.tools.xjc.api.XJC; public class JAXCodeGen { public static void main(String[] args)…
Sandip patil
  • 93
  • 2
  • 12
0
votes
2 answers

When extending JAXBEqualsStrategy, generated equals is different than when not extending

We extend JAXBEqualsStrategy via pom: -Xequals-equalsStrategyClass=com.acme.foo.CustomEqualsStrategy The CustomEqualsStrategy extends JAXBEqualsStrategy. After running MAVEN clean install generate-source in Eclipse (Keplar) our…
0
votes
3 answers

Auto Generate Java Skeleteon Class from XML

I have an xml file that looks a little like this : I was wondering how I could then generate a…
0
votes
1 answer

Determine object hierarchy of java class generated by XJC

I have a XSD file ( which contains complex structure ). I generated java class using XJC command. Now I want to know which is parent class and which is child class programmatically. Any idea or help will be highly appreciated Cheers
Arvind
  • 1,145
  • 6
  • 21
  • 43
0
votes
0 answers

xjc: XML Validation issue

I am trying to generate java code using xjc. My xsd is having following element
dgm
  • 1,945
  • 1
  • 20
  • 25
0
votes
0 answers

Pre Process XML file to be used in unmarshaller

I have a very very large xml file where each attribute occupies one line as shown below
user2133404
  • 1,539
  • 4
  • 25
  • 53
0
votes
0 answers

Confused how to generate a XML file from a list

First of all I used the xjc command to generate a Java Class called 'Site' that correlated with a xsd file that I provided. The command also created a ObjectFactory class. The XML file that I want to create is rather messy, so I was wondering if…
user1413969
  • 1,201
  • 1
  • 11
  • 22
0
votes
2 answers

Determine the order of xml mixed content in derived class

I have the schema like this :
Harsh Shah
  • 198
  • 1
  • 8