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; /*w w w . j av a 2 s .c o 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; } }