Top Description Fields Constructors Methods
com.sun.faces.ext.validator

public Class CreditCardValidator

extends Object
implements Validator, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javax.faces.validator.Validator, java.util.EventListener
Imports
javax.faces.validator.Validator, .ValidatorException, javax.faces.context.FacesContext, javax.faces.component.UIComponent, javax.faces.application.FacesMessage, java.util.Locale, java.io.Serializable

A Validator that checks against a Regular Expression (which is the pattern property). The pattern must resolve to a String that follows the java.util.regex standards.
Author
driscoll

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private boolean
luhnCheck(String number)

private String
public void
validate(FacesContext
Context of this request
context
,
UIComponent
The component wrapping this validator
component
,
Object
A string which will be compared to the pattern property of this validator. Must be a string.
obj
)

Implements javax.faces.validator.Validator.validate.

Validate a String against a regular expression pattern...
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

CreditCardValidatorback to summary
public CreditCardValidator()

Method Detail

luhnCheckback to summary
private boolean luhnCheck(String number)
stripNonDigitback to summary
private String stripNonDigit(String s)
validateback to summary
public void validate(FacesContext context, UIComponent component, Object obj)

Implements javax.faces.validator.Validator.validate.

Validate a String against a regular expression pattern... The full regex pattern must be matched in order to pass the validation.

Parameters
context:FacesContext

Context of this request

component:UIComponent

The component wrapping this validator

obj:Object

A string which will be compared to the pattern property of this validator. Must be a string.

Annotations
@Override