Back to project page Android-sample.
The source code is released under:
Apache License
If you think the Android project Android-sample 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; //from w w w. j a v a2 s .c o m import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Abstract class for a multivalidator. * @see AndValidator * @see OrValidator * @author Andrea Baccega <me@andreabaccega.com> * */ public abstract class MultiValidator extends Validator { protected final List<Validator> validators; public MultiValidator(String message, Validator ...validators) { super(message); if (validators == null) throw new NullPointerException("validators is null"); this.validators = new ArrayList<Validator>(Arrays.asList(validators)); } public MultiValidator(String message) { super(message); this.validators = new ArrayList<Validator>(); } public void enqueue(Validator newValidator) { validators.add(newValidator); } }