Back to project page android-edittext-validator.
The source code is released under:
MIT License
If you think the Android project android-edittext-validator listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.andreabaccega.formedittextvalidator; /* www . j a va 2s .c o m*/ import android.widget.EditText; /** * The AND validator checks if all of the passed validators is returning true.<br/> * Note: the message that will be shown is the one of the first failing validator * @author Andrea B. * */ public class AndValidator extends MultiValidator { public AndValidator( Validator ... validators) { super(null, validators); } public AndValidator() { super(null); } public boolean isValid(EditText et) { for (Validator v: validators) { if (! v.isValid(et)) { this.errorMessage = v.getErrorMessage(); return false; // Remember :) We're acting like an || operator. } } return true; } }