jaxb

JAXB and Inheritance

JAXB and Inheritance
I have this xsd :<?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/XsdMath2" xmlns:tns="http://www.example.org/XsdMath2&quo

Jaxb complex xml unmarshall

Jaxb complex xml unmarshall
I am having issues to unmarshall nested xml below. Can someone please advice if I am missing something. body tag can contain any Jaxb anotated obj. Do I have to create a custom adapter for marshalling/unmarshalling such an xml?Input XML<?xml version=

Change element name of a JAXB annotated subclass

Change element name of a JAXB annotated subclass
I am trying to create a jaxb class hierarchy for a web services domain. I find it inconvenient that a subclass that overrides a getter method in the super class can change the element name that JAXB outputs, but the super class's one is also being wr

How to retrievea particular tag value from the cdata section using xsl

How to retrievea particular tag value from the cdata section using xsl
My XML is like bellow<?xml version="1.0" encoding="UTF-8"?> <Students> <![CDATA[<?xml version="1.0" encoding="UTF-8"?> <Student><rno>1</rno><name>xyz</name> </st

JAXB: How do I annotate classes so that they belong to different namespaces?

JAXB: How do I annotate classes so that they belong to different namespaces?
I want to haveJAXB-annotatedclasses which would be marshalled/unmarshalled todifferent XML namespaces.What I need is something like:<someRootElement xmlns="urn:my:ns1" xmlns:a="urn:my:ns2" xmlns:b="urn:my:ns3"> <some

How to avoid loading lazy bidirectional relationships with MOXy?

How to avoid loading lazy bidirectional relationships with MOXy?
My question is a follow up tothiscomment.I'm mixing JPA and JAXB (MOXy) annotations on the same class, which works fine most of the time. As described in the linked thread,@XmlInverseReferenceprevents cycle exceptions when bidirectional relationships

How to Marshall and Unmarshall Map using JAXB [duplicate]

How to Marshall and Unmarshall Map using JAXB [duplicate]
This question already has an answer here:JAXB: how to marshall map into <key>value</key>9 answersI am trying to implement some code so I can marshall and unmarshall some xml using JAXB.Basically, I have a xml in the following format:<root a

JAXB Class Instance Listener

JAXB Class Instance Listener
What is the way to specify Class Instance based JAXB Listener (as in Entity Bean) like : afterUnmarshall , beforeMarshall but on every class instance based (by implementing any interface or by annotation)[email protected](name = "Person") // Edit

Enums don't match schema: problem with jaxb or xsd?

Enums don't match schema: problem with jaxb or xsd?
I'm trying to use JAXB to unmarshalthis fileinto Java objects. I know that there's a problem with SAX in J6 that rejects the maxOccurs line, and I've changed it tounbounded. However, when Ixjcit, it's not creating all the classes & enums I need. For

Why is jaxws-maven-plugin showing these warnings?

Why is jaxws-maven-plugin showing these warnings?
Everything is working fine, but I am puzzled as to what's going on with these warnings.When I run thewsimportgoal, for each of my project's test dependencies it reports that it "cannot find file".[INFO] --- jaxws-maven-plugin:2.3:wsimport (defau

Can/Should I list inherited properties for a JAXB mapped bean in the “propOrder” annotation?

Can/Should I list inherited properties for a JAXB mapped bean in the “propOrder” annotation?
I have a bunch of JAXB annotated classes that have a field in common, so I moved that field to a super class, like thispublic class Base { protected SomeType commonField; } @XmlRootElement(name = "foo") @XmlType(propOrder = { "commonField&q

Marshalling Entities with xml inverse references involving a custom comparator

Marshalling Entities with xml inverse references involving a custom comparator
I'm trying to marshall an arrangment of 3 entites taking advantage of MOxy's @XmlInverseReference annotation. My scenario very much mirrors the example provided hereprovided hereEntity A holds a collection of entity B which in turn holds a collection

Parse XML to different data structure with JAXB

Parse XML to different data structure with JAXB
I'm working on a tool to query Eve-Central. Eve-Central queries are returned in XML format, as such:<evec_api version="2.0" method="marketstat_xml"> <marketstat> <type id="608"> <buy> <volume>740

JAXB - unmarshal XML exception

JAXB - unmarshal XML exception
I've tried to read a big xml file (something like 500MB). First of all, I used xjc with the XSD file of my XML. All classes were generated as expected. Trying to read the file I've got this error: javax.xml.bind.UnmarshalException: unexpected element

XSD mapping to Java POJOs

XSD mapping to Java POJOs
Let's say I have an XML source from a web service, that I have no control over, with the following structure:<wrapper> <baz>content</baz> <foo> <bar>content</bar> <bar>content</bar> </foo> </wrapper

JAXB parse xml document

JAXB parse xml document
<?xml version="1.0" encoding="UTF-8"?> <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="2" yahoo:created="2016-02-17T21:25:49Z" yahoo:lang="en-US"> <results&g

resteasy, jaxb - How to produce a collection/list of strings?

resteasy, jaxb - How to produce a collection/list of strings?
Simple task, I need to produce this XML:<collection> <name>bill</name> <name>monica</name> <collection>instead of this (see following example:19.6. Arrays and Collections of JAXB Objects):<collection> <customer

Jackson Deserialize to POJO Based On Object Properties

Jackson Deserialize to POJO Based On Object Properties
Is it possible to deserialize JSON using Jackson into one of two types based on the content of the JSON?For example, I have the following Java (technically Groovy, but that's not important) interfaces and classes:interface Id { Thing toThing() } clas

WSDL with duplicate names — how to force Java Class names

WSDL with duplicate names — how to force Java Class names
Background:We are developing an application that communicates with several 3rd party webservices. Sadly, one of them has defined a WSDL file using poor naming conventions. The same names are often re-used for a response element, and the complexType t

What is the XML namespace for 'xml:whatever'?

What is the XML namespace for 'xml:whatever'?
I am trying to use JAXB to extract an attribute 'xml:lang' from the following:<?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0&qu
What Others Are Reading