Android Open Source - android-edittext-validator Edit Text Validator






From Project

Back to project page android-edittext-validator.

License

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.

Java Source Code

package com.andreabaccega.widget;
/*from  www .j av  a2 s.c om*/
import android.content.Context;
import android.text.TextWatcher;
import android.widget.EditText;

import com.andreabaccega.formedittextvalidator.Validator;

/**
 * Interface for encapsulating validation of an EditText control
 */
public interface EditTextValidator {
  /**
   * Add a validator to this FormEditText. The validator will be added in the
   * queue of the current validators.
   * 
   * @param theValidator
   * @throws IllegalArgumentException
   *             if the validator is null
   */
  public void addValidator(Validator theValidator)
      throws IllegalArgumentException;

  /**
   * This should be used with {@link #addTextChangedListener(TextWatcher)}. It
   * fixes the non-hiding error popup behaviour.
   */
  public TextWatcher getTextWatcher();

  public boolean isEmptyAllowed();

  /**
   * Resets the {@link Validator}s
   */
  public void resetValidators(Context context);

  /**
   * Calling *testValidity()* will cause the EditText to go through
   * customValidators and call {@link #Validator.isValid(EditText)}
   * Same as {@link #testValidity(boolean)} with first parameter true
   * @return true if the validity passes false otherwise.
   */
  public boolean testValidity();

    /**
     * Calling *testValidity()* will cause the EditText to go through
     * customValidators and call {@link #Validator.isValid(EditText)}
     * @param showUIError determines if this call should show the UI error.
     * @return true if the validity passes false otherwise.
     */
    public boolean testValidity(boolean showUIError);

    public void showUIError();

  final int TEST_REGEXP = 0;

  final int TEST_NUMERIC = 1;

  final int TEST_ALPHA = 2;

  final int TEST_ALPHANUMERIC = 3;

  final int TEST_EMAIL = 4;

  final int TEST_CREDITCARD = 5;

  final int TEST_PHONE = 6;

  final int TEST_DOMAINNAME = 7;

  final int TEST_IPADDRESS = 8;

  final int TEST_WEBURL = 9;

  final int TEST_NOCHECK = 10;

  final int TEST_CUSTOM = 11;

  final int TEST_PERSONNAME = 12;

  final int TEST_PERSONFULLNAME = 13;

  final int TEST_DATE = 14;
  
  final int TEST_NUMERIC_RANGE = 15;

}




Java Source Code List

com.andreabaccega.edittextformexample.CiaoValidator.java
com.andreabaccega.edittextformexample.EditTextFormExampleActivity.java
com.andreabaccega.edittextformexample.EmailOrCreditCard.java
com.andreabaccega.edittextformexample.LayoutExampleActivity.java
com.andreabaccega.edittextformexample.SettingsActivity.java
com.andreabaccega.edittextformexample.utils.LayoutListItem.java
com.andreabaccega.edittextformexample.utils.ListItem.java
com.andreabaccega.edittextformexample.utils.SimpleListItem.java
com.andreabaccega.formedittextvalidator.AlphaNumericValidator.java
com.andreabaccega.formedittextvalidator.AlphaValidator.java
com.andreabaccega.formedittextvalidator.AndValidator.java
com.andreabaccega.formedittextvalidator.CreditCardValidator.java
com.andreabaccega.formedittextvalidator.DateValidator.java
com.andreabaccega.formedittextvalidator.DomainValidator.java
com.andreabaccega.formedittextvalidator.DummyValidator.java
com.andreabaccega.formedittextvalidator.EmailValidator.java
com.andreabaccega.formedittextvalidator.EmptyValidator.java
com.andreabaccega.formedittextvalidator.IpAddressValidator.java
com.andreabaccega.formedittextvalidator.MultiValidator.java
com.andreabaccega.formedittextvalidator.NotValidator.java
com.andreabaccega.formedittextvalidator.NumericRangeValidator.java
com.andreabaccega.formedittextvalidator.NumericValidator.java
com.andreabaccega.formedittextvalidator.OrValidator.java
com.andreabaccega.formedittextvalidator.PatternValidator.java
com.andreabaccega.formedittextvalidator.PersonFullNameValidator.java
com.andreabaccega.formedittextvalidator.PersonNameValidator.java
com.andreabaccega.formedittextvalidator.PhoneValidator.java
com.andreabaccega.formedittextvalidator.RegexpValidator.java
com.andreabaccega.formedittextvalidator.SameValueValidator.java
com.andreabaccega.formedittextvalidator.Validator.java
com.andreabaccega.formedittextvalidator.WebUrlValidator.java
com.andreabaccega.widget.DefaultEditTextValidator.java
com.andreabaccega.widget.EditTextValidator.java
com.andreabaccega.widget.FormAutoCompleteTextView.java
com.andreabaccega.widget.FormEditText.java
com.andreabaccega.widget.ValidatingEditTextPreference.java