Details
-
Type: New Feature
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Annotations
-
Labels:None
Description
Would be nice for XStream to support simple validation of fields after de-serialization. E.g.
non-null:
@XStreamRequired
private Type field;
non-empty lists
@XStreamRequired
@XStreamNotEmpty
private List list;
Usually after deserialization, people have to write validation code that walks through objects to make sure everything is set right. Something like above will help do this without any additional code.
Additionally, a custom interface can also be implemented (supported by xstream) to do custom validation post de-serialization, e.g.
public void validate() throws something;