org.apache.myfaces.commons.validator
Class AbstractCreditCardValidator

java.lang.Object
  extended by org.apache.myfaces.commons.validator.ValidatorBase
      extended by org.apache.myfaces.commons.validator.AbstractCreditCardValidator
All Implemented Interfaces:
EventListener, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.validator.Validator

@JSFValidator(name="mcv:validateCreditCard",
              clazz="org.apache.myfaces.commons.validator.CreditCardValidator",
              bodyContent="empty",
              tagClass="org.apache.myfaces.commons.validator.ValidateCreditCardTag",
              serialuidtag="3810660506302799072L")
public abstract class AbstractCreditCardValidator
extends ValidatorBase

A custom validator for creditCards, based upon Jakarta Commons. Unless otherwise specified, all attributes accept static values or EL expressions

Version:
$Revision: 1021620 $ $Date: 2010-10-11 23:09:48 -0500 (Mon, 11 Oct 2010) $
Author:
mwessendorf (latest modification by $Author: lu4242 $)

Field Summary
static String CREDITCARD_MESSAGE_ID
          The message identifier of the FacesMessage to be created if the creditcard check fails.
static String VALIDATOR_ID
          The standard converter id for this converter.
 
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
 
Constructor Summary
AbstractCreditCardValidator()
           
 
Method Summary
abstract  boolean isAmex()
          american express cards
abstract  boolean isDiscover()
          validation for discover
abstract  boolean isMastercard()
          validation for mastercard
abstract  boolean isNone()
          none of the given cardtypes is allowed.
abstract  boolean isVisa()
          validation for visa
abstract  void setAmex(boolean b)
           
abstract  void setDiscover(boolean b)
           
abstract  void setMastercard(boolean b)
           
abstract  void setNone(boolean b)
           
abstract  void setVisa(boolean b)
           
 void validate(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, Object value)
           
 
Methods inherited from class org.apache.myfaces.commons.validator.ValidatorBase
clearInitialState, getDetailMessage, getFacesContext, getFacesMessage, getMessage, getStateHelper, getStateHelper, getStringValue, getSummaryMessage, getValueExpression, initialStateMarked, isTransient, markInitialState, restoreAttachedState, restoreState, saveAttachedState, saveState, setDetailMessage, setMessage, setSummaryMessage, setTransient, setValueExpression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATOR_ID

public static final String VALIDATOR_ID

The standard converter id for this converter.

See Also:
Constant Field Values

CREDITCARD_MESSAGE_ID

public static final String CREDITCARD_MESSAGE_ID

The message identifier of the FacesMessage to be created if the creditcard check fails.

See Also:
Constant Field Values
Constructor Detail

AbstractCreditCardValidator

public AbstractCreditCardValidator()
Method Detail

validate

public void validate(javax.faces.context.FacesContext facesContext,
                     javax.faces.component.UIComponent uiComponent,
                     Object value)
              throws javax.faces.validator.ValidatorException
Throws:
javax.faces.validator.ValidatorException

isAmex

@JSFProperty(defaultValue="true")
public abstract boolean isAmex()
american express cards


isDiscover

@JSFProperty(defaultValue="true")
public abstract boolean isDiscover()
validation for discover


isMastercard

@JSFProperty(defaultValue="true")
public abstract boolean isMastercard()
validation for mastercard


isNone

@JSFProperty(defaultValue="false")
public abstract boolean isNone()
none of the given cardtypes is allowed.


isVisa

@JSFProperty(defaultValue="true")
public abstract boolean isVisa()
validation for visa


setAmex

public abstract void setAmex(boolean b)

setDiscover

public abstract void setDiscover(boolean b)

setMastercard

public abstract void setMastercard(boolean b)

setNone

public abstract void setNone(boolean b)

setVisa

public abstract void setVisa(boolean b)


Copyright © 2007-2011 The Apache Software Foundation. All Rights Reserved.