Questions tagged [jaxb2-basics]

JAXB2 Basics is an open source project which implements plugins and tools for JAXB 2.x reference implementation.

JAXB2 Basics is an open source project which implements plugins and tools for JAXB 2.x reference implementation. JAXB2 Basics is a part of the JAXB2 Commons project.

The implementation of JAXB2 plugins is available in this JAXB2 Basic project.

67 questions
3
votes
1 answer

JAXB apply bindings to more than one .xsd schema

I have several XML schemas over which I do not have control and I'd like to apply certain customizations when generating the Java classes via XJC. Some customizations should apply to all .xsd files, but I'm not sure how to achieve this. At the…
Paul
  • 20,883
  • 7
  • 57
  • 74
3
votes
1 answer

JAXB with nested elements

To create an XML like the above I am creating classes for productInfo, product, productPrice and then I am "unmarshalling" using JAXB…
3
votes
2 answers

How to use jaxb_commons plugins from maven

I'm trying to use a jaxb plugin to insert a interface into a choice element generating the classes from maven. The problem is that I can't seem to figure out how to do so from maven, the repository isn't clear from the documentation and the only…
user243155
3
votes
1 answer

Validate nested object from complex object using jaxb

I have a xml representation of object like OrderList (has list of) Orders and each order has a list of commodities. I want to validate my commodities and if not valid I want to remove them from order. If all commodities are invalid then I remove…
Rohit
  • 353
  • 2
  • 8
  • 24
3
votes
1 answer

JAXB equals and Hashcode: gives error

I'm trying to get my pom.xml to generate the hashCode() and equals methods() on my JAXB objects.
jeff porter
  • 6,560
  • 13
  • 65
  • 123
3
votes
2 answers

ClassNotFoundException with jaxb/annox and custom annotation

I'm a little stuck with an annotations usage scenario and I was hoping for your input. Given the following annotation (defined in the same project along with ExistingCustomerValidator class ) package com.tktserver.constraints; @Target({…
Ioannis
  • 124
  • 10
2
votes
3 answers

Is there a way to generate value constructors when creating Java code using jakarta dependencies in JAXB?

I'm migrating my JAXB code from the javax.* to the jakarta.* dependencies. Until now I used the following maven plugin to generate the Java…
2
votes
1 answer

JAXB2 cannot generate classes for XSD due to '[..]ToStringStrategy cannot be converted to [..]ToStringStrategy2'

I've found an issue with toString generation when using maven-jaxb2-plugin with org.jvnet.jaxb2_commons.jaxb2-basics at version 0.12.0. Instead of generating JAXBToStringStrategy.INSTANCE2, it uses INSTANCE which is incompatible with…
n1t4chi
  • 502
  • 2
  • 12
2
votes
1 answer

JAXB2 Basics Plugins - Issue with schemaLocation in my External binding customization file

I am using JAXB to generate classes from my XSD file. I would like to have the classes that are generated implement a common interface. So I am trying out the JAXB2 Basics plugin with the external binding file approach to do this. This is my custom…
Kuldeep Jain
  • 8,409
  • 8
  • 48
  • 73
2
votes
1 answer

JAXB2 Basic Annotate plugin not working with maven cxf-codegen-plugin

I'm using the cxf-codegen-plugin to generate Java classes from wsdl files. I want to add annotations to once of the classes and I specify a Binding File and use the jaxb2-basics-annotate plugin to do so. The generated files don't contain the the…
Vidhuran
  • 212
  • 4
  • 16
1
vote
2 answers

How to tell only certain Classes in XSD to inheirt from a provided interface?

I have found some other questions that ask this in a different way, but none of the answers to those questions work. Either the sites they refer to are dead or they are not for JAXB2. What I need is for more than a few of the generated classes to…
user177800
1
vote
1 answer

maven-jaxb2-plugin isn't generating any output

I'm new to Maven, and am trying to use it to generate the Java classes from my XSD. My xsd file is in src/main/resources/xsd In dependencies I have this, but I don't think I need it as I'm using Java 1.6
Scott The Scot
  • 47
  • 1
  • 1
  • 7
1
vote
0 answers

isSet methods not generated using jaxb2-basics simplify plugin

I have a schema with two elements within a block, as per the following fragment:
pcesarperez
  • 67
  • 1
  • 8
1
vote
1 answer

JAXB2 Basics Mergeable plugin: Setting a custom Merge Strategy

I have successfully activated the JAXB2 Basics 'Mergeable' plugin in an ant script as follows:
got_bainne
  • 76
  • 4
1
vote
1 answer

Nested XML unmarshalling to POJO class

I am new to JAXB marshalling and unmarshalling, I am trying to unmarshall a nested XML to Java POJO class, but i am getting null in the unmarshalled object. Also I want to confirm if I have created the POJO Classes correctly for the corresponding…
Sam
  • 97
  • 1
  • 14