jibx

Jibx: Integrate base class output into extending class output

I have this class model: abstract class A { int a; } class B extends A { int b; } class C extends B { int c; } And I'd like to get jibx to output this XML: <B b=1 a=0> <children> <C c=2 b=1 a=0/> </children> </B> I have this binding xml: <binding> <mapping class="A" abstract="true"> <value nam...

How to name a class generated by JIBX through codegen

I have an XML schema that has an element named Con, unfortunately con is an illegal file name on windows so when I use codegen to generated java classes it fails. What I'm trying to do is get JIBX's codegen to rename the class but it doesn't seem to work. This is JIBX 1.2.1 Example schema: <?xml version="1.0" encoding="UTF-8" ?> <xs:...

JiBX on Android (or any other build-time bytecode manipulating library)

I'm considering the use of JiBX for a project that will have to run on both Blackberry and RIM. While it seems like J2ME use of JiBX has been considered by the community (as per JiBX jira tickets), Android is relatively new. The question is, therefore, this: has anybody had any success (or issues, for that matter) using JiBX on Android,...

JiBX: How do I keep using interfaces in my code?

How can I keep my using interfaces in classes I want to use JiBX binding with? Example: I have this very simple model in java: public interface A { B getB(); void setB(B b); } public interface B { String getData(); void setData(String data); } public class AImpl implements A { B b; @Override public B getB...

JiBX "bind on load" and JUnit

Has anyone been successful in using JiBX "bind on load" mechanism while running a JUnit test case? What were the steps taken? How did you managed to use IDE test running integration with this solution? ...

Jibx always gives "Error during validation: null"

I'm really stumped on this incredibly simple mapping. It looks just like one of the examples even. If I comment out the internal structure, it'll run the binding compiler successfully. If I put the internal structure back in, it fails. Note that the internal structure is just defining the XML. This is basically example5 of the JIBX tutor...

Jibx - Map generated class to existing interface

How can we implement generated jibx classes to existing interface? In Binding the options are only for extending to a class, but not implementing an interface. I couldnt find any documents related to it in jibx tutorial. Can someone help me out? ...

JiBX bind value with getter only

I have a class with a complex method which returns boolean (no property field or setter for this field provided). I need to bind this class with JiBX so result of the method would be marshalled to XML element/attribute and would be omitted when unmarshalling. So I want to get something like this: <mapping name="freak" class="com.test.Fr...

JiBX binding - root object extends an object

Is even possible to bind an root object with super fields? I have quite complicated entity (entities) to bind. I am already lost with it :) This is my code situation: public class CoreRestWrapper { private Integer page; private Integer perPage; } public class UserWrapper extends CoreRestWrapper { private Collection<UserCV...

JiBXException: Multiple bindings defined for class

Strange thing... I have a binding definition user-wrapper.xml: <binding> <include path="core-wrapper.xml" /> <include path="user-composite-entity.xml" /> <mapping name="users" class="UserWrapper" extends="CoreWrapper"> <structure map-as="CoreWrapper" usage="optional" /> <collection field="users" usage="optional" ...

Simple Java Xml to POJO mapping/binding?

Hey guys, I'm trying to figure out the simplest way to map an xml file to to a plain old java object. Note: That in my example the xml doesn't quite match up with my intended POJO. ///////// THE XML <?xml version="1.0" encoding="UTF-8"?> <Animal> <standardName> <Name>Cat</Name> </standardName> <standardVersion> <Versio...

In Java for XML marshalling/unmarshalling which utility should we use from JAXB, JIBX, CASTOR, ADB etx?

In Java for XML marshalling/unmarshalling one can use JAXB, JIBX, CASTOR, ADB etc. But out of these which is most generic & commonly used? Or is there any other utility available? ...

JIBX : Mapping an element with Attribute and Value

Hi, Can you please give us the mapping for the following xml structure ? 3.14159265358979E0 4.14159265358979E0 5.14159265358979E0 We were not able to find mapping for elements with both Attribute and Value. Thanks, Sriram. ...

JiBX unmarshalling - is it possible to tell JiBX to ignore the order of elements??

Is there a way to get by this? For example, my XML: <group> <idExt>new group idext</idExt> <user-id>1</user-id> <parent-id>2</parent-id> </group> when unmarshalling, goes without errors, but when I change order: <group> <user-id>1</user-id> <parent-id>2</parent-id> <idExt>new group idext</idExt> </gro...

JiBX binding DTD schema in Eclipse

I have warnings in binding xml files: No grammar constraints (DTD or XML schema) detected for the document. I have done as is written in the answer here: http://stackoverflow.com/questions/982263/jibx-how-do-i-keep-using-interfaces-in-my-code (answer which is not accepted). But now I have an error in binding xml file: Referenced file...

JIBX MAVEN Problem

I am trying to use JIBX maven plugin in my Spring Web Service project, My project has diferent layers (API-DAO-SERVICE vsvs..) these layers are individual projects and has maven dependency each other. In my WEB project's POM, I add other project as dependencies, and my mapping classes are all in API project. Even in my w...

How to import an XML schema into the "no namespace"

I have a schema here where I am trying to include/import another schema that has no namespace (and this cannot be changed because it comes from another vendor and it would no longer validate their XML). Here is the first Schema: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:samp="http://sample/namespace" targetNamespace...

JiBX: How to run codegen on a schema that imports into the no-namespace schema

I have a schema here where I am trying to include/import another schema that has no namespace (and this cannot be changed because it comes from another vendor and it would no longer validate their XML). Here is the first Schema: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:samp="http://sample/namespace" targetNamespace...

XML Marshalling: How to add an attribute from another namespace to an element

I want to generate this XML: <myElement myAttribute="whateverstring" xsi:type="hardPart"/> I have this XSD: <xsd:element name="myElement"> <xsd:complexType> <xsd:attribute name="myAttribute" type="xsd:boolean" /> <!-- need to add the xsi:attribue here --> </xsd:complexType> </xsd:element> How exactly can I a...

How do I get Jibx to add two different objects implementing the same interface in a collection?

Like the title says, I have two different objects that implement the same interface and I want to add them to the same collection. My XML looks like: <root> <item-list> <item> <type1> <id>1</id> </type1> </item> <item> <type2> <id>2</id> <other>1</other> ...