com.ibm.xsp.validator
Class ModulusSelfCheckValidator

java.lang.Object
  extended by com.ibm.xsp.complex.ValueBindingObjectImpl
      extended by com.ibm.xsp.validator.AbstractValidator
          extended by com.ibm.xsp.validator.ModulusSelfCheckValidator
All Implemented Interfaces:
ComponentBindingObject, ValueBindingObject, java.util.EventListener, javax.faces.component.StateHolder, javax.faces.validator.Validator

public class ModulusSelfCheckValidator
extends AbstractValidator

A modulus self check validator with support for automatic client-side validation and computed expressions on its properties. Corresponds to xp:validateModulusSelfCheck tag


Field Summary
 
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
 
Constructor Summary
ModulusSelfCheckValidator()
           
 
Method Summary
 java.lang.String getInvalidMessage()
          Return a message that tells the user the value entered is invalid
 int getModulus()
          Return the modulus algorithm to use, either 10 or 11, defaulting to 10.
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setModulus(int modulus)
          Modulus specifies which IBM Modulus Self Check Algorithm to use.
 void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object value)
           
 
Methods inherited from class com.ibm.xsp.validator.AbstractValidator
addInputInvalidMessage, createNullContextOrComponentEx, createValidatorEx, getInvalidRangeMessage, getMessage, getNotCorrectTypeMessage, setMessage
 
Methods inherited from class com.ibm.xsp.complex.ValueBindingObjectImpl
getComponent, getFacesContext, getValueBinding, isTransient, setComponent, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModulusSelfCheckValidator

public ModulusSelfCheckValidator()
Method Detail

getModulus

public int getModulus()
Return the modulus algorithm to use, either 10 or 11, defaulting to 10.

Returns:
modulus

setModulus

public void setModulus(int modulus)
Modulus specifies which IBM Modulus Self Check Algorithm to use. entering 10 specifies the IBM Modulus 10 Self-check Algorithm is to be used. entering 11 specifies the IBM Modulus 11 Self-check Algorithm is to be used.

Set the value of the modulus property.


validate

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

getInvalidMessage

public java.lang.String getInvalidMessage()
Return a message that tells the user the value entered is invalid

Returns:
invalid message

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class AbstractValidator

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class AbstractValidator