Class Mod10ValidationRule

  extended by org.apache.cocoon.woody.datatype.validationruleimpl.AbstractValidationRule
      extended by org.apache.cocoon.woody.datatype.validationruleimpl.Mod10ValidationRule
All Implemented Interfaces:

public class Mod10ValidationRule
extends AbstractValidationRule

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 are depended on the credit card type and such validation is not performed by this validation rule.

$Id: Mod10ValidationRule.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Constructor Summary
Method Summary
 boolean supportsType(Class clazz, boolean arrayType)
          Returns true if this ValidationRule supports validating objects of the same class as the one specified.
 ValidationError validate(Object value, org.outerj.expression.ExpressionContext expressionContext)
Methods inherited from class org.apache.cocoon.woody.datatype.validationruleimpl.AbstractValidationRule
evaluateComparable, evaluateNumeric, getFailMessage, hasFailMessage, setFailMessage
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public Mod10ValidationRule()
Method Detail


public ValidationError validate(Object value,
                                org.outerj.expression.ExpressionContext expressionContext)
value - a value of a class supported by the ValidationRule implementation
expressionContext - many validation rules use the xReporter expression interpreter, the expressionContext allows to resolve variables used in these expressions.


public boolean supportsType(Class clazz,
                            boolean arrayType)
Description copied from interface: ValidationRule
Returns true if this ValidationRule supports validating objects of the same class as the one specified. If the flag 'arrayType' is true, this method will return true if this validation rule can validate arrays of these objects (i.e. the object passed to the validate method will then be an array).

Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.