Form validation library for Android?

后端 未结 7 2154
自闭症患者
自闭症患者 2020-12-09 09:48

Is there any mature form validation API / library for Android? I\'ve found http://code.google.com/p/android-binding/ but it seems that is under heavy development.

7条回答
  •  情深已故
    2020-12-09 10:34

    I would recommend OVal

    public class BusinessObject {
    
    @NotNull
    @NotEmpty
    @Length(max=32)
    private String name;
    
     ...
    }
    
    // collect the constraint violations
    List violations = validator.validate(bo);
    

    I'm planing to uses it in my next project since is has a variety of expression languages, but only Java is hard required.

    It is not JSR303 compilant, but supports those annotations too.

提交回复
热议问题