org.apache.wicket.validation.validator
Class CreditCardValidator

java.lang.Object
  extended by org.apache.wicket.validation.validator.AbstractValidator
      extended by org.apache.wicket.validation.validator.CreditCardValidator
All Implemented Interfaces:
java.io.Serializable, IClusterable, INullAcceptingValidator, IValidator

public class CreditCardValidator
extends AbstractValidator

Performs the so-called "mod 10" algorithm to check the validity of credit card numbers such as VISA.

In addition to this, the credit card number can be further validated by its length and prefix, but those properties depend upon the credit card type, and such validation is not performed by this validator.

Since:
1.2.6
Author:
Johan Compagner
See Also:
Serialized Form

Constructor Summary
CreditCardValidator()
           
 
Method Summary
protected  void onValidate(IValidatable validatable)
          Validates the IValidatable instance.
 
Methods inherited from class org.apache.wicket.validation.validator.AbstractValidator
error, error, error, error, messageModel, resourceKey, resourceKey, validate, validate, validateOnNullValue, variablesMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CreditCardValidator

public CreditCardValidator()
Method Detail

onValidate

protected void onValidate(IValidatable validatable)
Description copied from class: AbstractValidator
Validates the IValidatable instance.

Specified by:
onValidate in class AbstractValidator
Parameters:
validatable - the given IValidatable instance
See Also:
AbstractValidator.onValidate(IValidatable)


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.