XStream
  1. XStream
  2. XSTR-514

Simple validation of fields with @XStreamRequired

    Details

    • Type: New Feature New Feature
    • Status: Open Open
    • Priority: Major 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;

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Parag Mehta
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated: