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; // w w w .j av a 2s .co m import android.widget.EditText; /** * Validator abstract class. To be used with FormEditText * @author Andrea Baccega <me@andreabaccega.com> * */ public abstract class Validator { protected String errorMessage; public Validator(String _customErrorMessage) { errorMessage = _customErrorMessage; } /** * Should check if the EditText is valid. * @param et the edittext under evaluation * @return true if the edittext is valid, false otherwise */ public abstract boolean isValid(EditText et); public boolean hasErrorMessage(){ return errorMessage != null; } public String getErrorMessage() { return errorMessage; } }