Package org.opencms.security
Class CmsDefaultValidationHandler
java.lang.Object
org.opencms.security.CmsDefaultValidationHandler
- All Implemented Interfaces:
I_CmsValidationHandler
Default implementation for the validation handler.
- Since:
- 6.3.0
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkEmail
(String email) The email should only be composed by digits and standard english letters, points, underscores and exact one "At" symbol.void
checkFirstname
(String firstname) Checks if the provided first name is valid.void
checkGroupName
(String name) Checks if the provided group name is a valid group name.void
checkLastname
(String lastname) Checks if the provided last name is valid.void
checkUserName
(String userName) A user name can only be composed of digits, standard ASCII letters and the symbols defined inUSERNAME_CONSTRAINTS
.void
checkZipCode
(String zipcode) That means, the parameter should only be composed by digits and standard english letters.
-
Field Details
-
EMAIL_REGEX
The email regular expression.- See Also:
-
USERNAME_CONSTRAINTS
The user name constraints.- See Also:
-
ZIPCODE_REGEX
The zipcode regular expression.- See Also:
-
-
Constructor Details
-
CmsDefaultValidationHandler
public CmsDefaultValidationHandler()
-
-
Method Details
-
checkEmail
The email should only be composed by digits and standard english letters, points, underscores and exact one "At" symbol.- Specified by:
checkEmail
in interfaceI_CmsValidationHandler
- Parameters:
email
- the email address to validate- Throws:
CmsIllegalArgumentException
- if the given email address is not valid- See Also:
-
checkFirstname
Description copied from interface:I_CmsValidationHandler
Checks if the provided first name is valid.- Specified by:
checkFirstname
in interfaceI_CmsValidationHandler
- Parameters:
firstname
- the first name to validate- Throws:
CmsIllegalArgumentException
- if the given email address is not valid- See Also:
-
checkGroupName
Description copied from interface:I_CmsValidationHandler
Checks if the provided group name is a valid group name.- Specified by:
checkGroupName
in interfaceI_CmsValidationHandler
- Parameters:
name
- the group name to check- Throws:
CmsIllegalArgumentException
- if the given group name is not valid- See Also:
-
checkLastname
Description copied from interface:I_CmsValidationHandler
Checks if the provided last name is valid.- Specified by:
checkLastname
in interfaceI_CmsValidationHandler
- Parameters:
lastname
- the last name to validate- Throws:
CmsIllegalArgumentException
- if the given email address is not valid- See Also:
-
checkUserName
A user name can only be composed of digits, standard ASCII letters and the symbols defined inUSERNAME_CONSTRAINTS
.- Specified by:
checkUserName
in interfaceI_CmsValidationHandler
- Parameters:
userName
- the user name to check- Throws:
CmsIllegalArgumentException
- if the given user name is not valid- See Also:
-
checkZipCode
That means, the parameter should only be composed by digits and standard english letters.- Specified by:
checkZipCode
in interfaceI_CmsValidationHandler
- Parameters:
zipcode
- the zip code to validate- Throws:
CmsIllegalArgumentException
- if the given zip code is not valid- See Also:
-