@Deprecated public class FrenchSiretFieldValidator extends NuitonFieldValidatorSupport
| Modifier and Type | Field and Description |
|---|---|
protected static Pattern |
p
Deprecated.
|
protected static String |
SIRET_REGEXP
Deprecated.
|
skip| Constructor and Description |
|---|
FrenchSiretFieldValidator()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
getDigit(char c)
Deprecated.
Converti un char en un entier '0' => 0 et '9' => 9, et 'A' => 10 a 'Z' => 36,
les autres caractere sont aussi convertis pour que 'a' = 10 et 'z' = 36.
|
String |
getValidatorType()
Deprecated.
|
static boolean |
luhnChecksum(String siret)
Deprecated.
Verifie la validite d'un numero en suivant l'algorithme Luhn tel que d'ecrit
dans wikipedia
Algo:
en fonction de la position du numero dans la sequence,
on multiplie pas 1 (pour les impaires) ou par 2 pour les paires
(1 etant le numero le plus a droite)
On fait la somme de tous les chiffres qui resulte de ces multiplications
(si un resultat etait 14, on ne fait pas +14 mais +1+4)
Si le résultat de cette somme donne un reste de 0 une fois divisé par 10
le numero est valide.
|
void |
validateWhenNotSkip(Object object)
Deprecated.
Method to be invoked when skip parameter was not evaludated to
true. |
evaluateSkipParameter, getFieldValue, setSkip, validategetFieldName, setFieldName, setValidatorTypeaddActionError, addFieldError, conditionalParse, getDefaultMessage, getMessage, getMessageKey, getMessageParameters, getParse, getValidatorContext, isShortCircuit, setDefaultMessage, setMessageKey, setMessageParameters, setParse, setShortCircuit, setValidatorContext, setValueStackprotected static final String SIRET_REGEXP
protected static final Pattern p
public void validateWhenNotSkip(Object object) throws com.opensymphony.xwork2.validator.ValidationException
NuitonFieldValidatorSupporttrue.validateWhenNotSkip in class NuitonFieldValidatorSupportobject - the object to be validated.com.opensymphony.xwork2.validator.ValidationException - is thrown if there is validation error(s).public String getValidatorType()
getValidatorType in interface com.opensymphony.xwork2.validator.ValidatorgetValidatorType in class com.opensymphony.xwork2.validator.validators.FieldValidatorSupportpublic static boolean luhnChecksum(String siret)
siret - une chaine composer que de chiffrepublic static int getDigit(char c)
c - le caractere qui doit etre convertiCopyright © 2011-2013 CodeLutin. All Rights Reserved.