Class FrenchPostCodeFieldValidator
java.lang.Object
com.opensymphony.xwork2.validator.validators.ValidatorSupport
com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
org.nuiton.validator.xwork2.field.NuitonFieldValidatorSupport
org.nuiton.validator.xwork2.field.FrenchPostCodeFieldValidator
- All Implemented Interfaces:
com.opensymphony.xwork2.validator.FieldValidator,com.opensymphony.xwork2.validator.ShortCircuitableValidator,com.opensymphony.xwork2.validator.Validator
public class FrenchPostCodeFieldValidator extends NuitonFieldValidatorSupport
Validate post codes for French cities
- Take into account 2A and 2B
- Take into account DOMs and TOMs
- Postcodes starting with 99 are not valid
- Since:
- 2.3
- Author:
- Jean Couteau - couteau@codelutin.com
-
Field Summary
Fields Modifier and Type Field Description protected static java.util.regex.Patternpprotected static java.lang.StringPOST_CODE_REGEXP -
Constructor Summary
Constructors Constructor Description FrenchPostCodeFieldValidator() -
Method Summary
Modifier and Type Method Description java.lang.StringgetValidatorType()voidvalidateWhenNotSkip(java.lang.Object object)Method to be invoked when skip parameter was not evaludated totrue.Methods inherited from class org.nuiton.validator.xwork2.field.NuitonFieldValidatorSupport
evaluateSkipParameter, getFieldValue, setSkip, validateMethods inherited from class com.opensymphony.xwork2.validator.validators.FieldValidatorSupport
getCurrentValue, getFieldName, setFieldName, setValidatorTypeMethods inherited from class com.opensymphony.xwork2.validator.validators.ValidatorSupport
addActionError, addFieldError, getDefaultMessage, getMessage, getMessageKey, getMessageParameters, getValidatorContext, isShortCircuit, parse, setDefaultMessage, setMessageKey, setMessageParameters, setShortCircuit, setTextProviderFactory, setValidatorContext, setValueStack
-
Field Details
-
POST_CODE_REGEXP
protected static java.lang.String POST_CODE_REGEXP -
p
protected static java.util.regex.Pattern p
-
-
Constructor Details
-
FrenchPostCodeFieldValidator
public FrenchPostCodeFieldValidator()
-
-
Method Details
-
validateWhenNotSkip
public void validateWhenNotSkip(java.lang.Object object) throws com.opensymphony.xwork2.validator.ValidationExceptionDescription copied from class:NuitonFieldValidatorSupportMethod to be invoked when skip parameter was not evaludated totrue.- Specified by:
validateWhenNotSkipin classNuitonFieldValidatorSupport- Parameters:
object- the object to be validated.- Throws:
com.opensymphony.xwork2.validator.ValidationException- is thrown if there is validation error(s).
-
getValidatorType
public java.lang.String getValidatorType()- Specified by:
getValidatorTypein interfacecom.opensymphony.xwork2.validator.Validator- Overrides:
getValidatorTypein classcom.opensymphony.xwork2.validator.validators.FieldValidatorSupport
-