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; // ww w . ja v a 2s .c om import android.widget.EditText; /** * The or validator checks if one of passed validators is returning true.<br/> * Note: the message that will be shown is the one passed to the Constructor * @author Andrea B. * */ public class OrValidator extends MultiValidator { public OrValidator( String message, Validator ... validators) { super(message, validators); } public boolean isValid(EditText et) { //TODO: What if we've no validators ? for (Validator v: validators) { if (v.isValid(et)) { return true; // Remember :) We're acting like an || operator. } } return false; } }