Hi,

I am trying to check if JiBX is suitable for my application and I
encounter some problems.
I need to unmarshall an XML document to create instances of Java classes
generated from an ECore metamodel.
That means that for example, collections have to be concordant with
EList types.
My first question is to compile the binding file, I had to regenerate
jbix-bind.jar with modified classpath (I added emf package for EList
support), but do I have another way to do this without any jar
modification ?
Second as soon as my EList could be found, it seems that JiBX wants to
modify EList.class file in order to add specific instructions. But it is
obvious that I can't modify such type.
Do you know some solution to this problem ?

Last I just want to tell that generated Java classes can't be modified
(no method adding or modifying) so does JiBX's idea copes with that
constraint ?

A bit of my binding file :

<mapping name="classA" class="classA">
 <value style="attribute" name="Id" field="id" ident="def"/>
  <structure name="classAAttributes" flexible="true" ordered="false">
   <value name="Name" field="name"/>
  </structure>
  <collection name="classAColl" field="occurrences"
                item-type="classAOc"
                type="org.eclipse.emf.common.util.Elist"/>
</mapping>

Associated Java code :

--------------classA-------------------------
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.EList;

public class ClassA {
        private String id;
        private String name;
        private EList occurrences;
        
        public Function(){
                this.occurrences = new BasicEList();
        }
}
--------------classAOc-----------------------
public class ClassAOc {

        private int num_oc;
        private String name;
        private ClassA classA;
        
        public FunctionOc(){
                
        }
}

Binding compiler error :

Unable to load class org.eclipse.emf.common.util.Elist; on collection
element

org.jibx.runtime.JiBXException: Cannot modify class 
                                org.eclipse.emf.common.util.EList

Thanks for your help.

CLAVREUL Mickael.


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to