[Simple-support] Problem during deserializing
Brought to you by:
niallg
|
From: joh sar..... <eh...@gm...> - 2011-06-10 13:35:55
|
Hi all,
Thanks for the library, it's very helpful and very efficient.
I am writing to you because I have a deserializing problem.
I try to deserializing a xml that i have serialized with your library and i
don't find my bug.
May be someone could help me or give me a clue;
The log is : ERROR/erreur(15302):
org.simpleframework.xml.core.PersistenceException: Constructor not matched
for class construction_Xml_Data.IDE
where IDE is one of my class that i have implemented. I don't know why it
did not find my class !
Thanks !
Johan
This is my code :
/-----------------------
@Root(strict = false)
public class Utilisateurs {
@ElementList(type = Medecin.class)
private ArrayList<Medecin> medecins;
@ElementList(type = IDE.class)
private ArrayList<IDE> ides;
... constructors and getters
------------------------------/
/---------------------------------
@Root
public class Medecin {
@Element
private String nom;
@Element
private String prenom;
@Element
private String specialite;
@Element
private int encours;
.... constructors and getters
-------------------------------------/
/---------------------------------------
@Root
public class IDE {
@Element
private String nom;
@Element
private String prenom;
@Element
private String specialite;
@Element
private int encours;
... constructor and getters
-------------------------------------------/
And that is the read code:
try {
Serializer serializer = new Persister();
File file = new File(path);
Utilisateurs util = serializer.read(Utilisateurs.class,
file,false); <--- the problem and i'm sure that my path is good
} catch (Exception e) {
// TODO Auto-generated catch block
Log.e("erreur", "pas d'ecriture xml", e);
}
|