You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a simple bean (class Phone) with just 2 fields (Strings) but the XML does not contain the fields and their set values, unless I explicitly annotate the fields (with @text or @Attribute for example).
Is there a way to serialize all the fields by default?
Code is:
Persister serializer = new Persister();
ByteArrayOutputStream b = new ByteArrayOutputStream();
Phone p = new Phone();
p.setType("typexxx");
p.setValue("1234567");
try {
serializer.write(p, b);
String string = b.toString();
Log.i("MyTag", string);
return string;
} catch (Exception e) {
Log.e("ERR", "Error", e);
return null;
}
The text was updated successfully, but these errors were encountered:
I made a simple bean (class Phone) with just 2 fields (Strings) but the XML does not contain the fields and their set values, unless I explicitly annotate the fields (with @text or @Attribute for example).
Is there a way to serialize all the fields by default?
Code is:
The text was updated successfully, but these errors were encountered: