[Simple-support] What should I do to handle null elements?
Brought to you by:
niallg
|
From: Beyer, D. <dou...@tr...> - 2011-07-16 14:43:23
|
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? |