Re: [Simple-support] What should I do to handle null elements?
Brought to you by:
niallg
|
From: Patacchiola, A. <ada...@tr...> - 2011-07-16 15:29:13
|
I the @optional attribute or similar might be what you need. There's good documentation on the source forge site. Sent from my HTC smartphone on the Now Network from Sprint! ----- Reply message ----- From: "Beyer, Doug" <dou...@tr...> To: "sim...@li..." <sim...@li...> Subject: [Simple-support] What should I do to handle null elements? Date: Sat, Jul 16, 2011 8:44 am I’m serializing a simple class and one of its data members is marked with the “@Element” attribute. In this particular case, the instance’s element value happens to be null. I get the following exception while trying to serialize the instance. org.simpleframework.xml.core.ElementException: Value for @org.simpleframework.xml.Element(name=, data=false, required=true, type=void) on field 'Payload' private java.lang.String com.troppus.data.POMRequest.Payload is null in class com.troppus.data.POMRequest. Is there a proper way to handle such cases? |