@Component public class UserValidator extends Object implements org.springframework.validation.Validator
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.log4j.Logger |
logger |
| Constructor and Description |
|---|
UserValidator() |
| Modifier and Type | Method and Description |
|---|---|
String |
checkForNaughtyChars(String itemToCheck)
Validates the user input against known bad characters.
|
String |
checkForNaughtyStrings(String itemToCheck)
Validates the user input against known bad strings.
|
boolean |
supports(Class clazz) |
void |
validate(Object obj,
org.springframework.validation.Errors errors)
Validates the user input contained in the User object.
|
void |
validateCenter(int input,
org.springframework.validation.Errors errors)
Validates the user input for the center field.
|
void |
validateEmailAddress(String input,
org.springframework.validation.Errors errors)
Validates the user input for the emailAddress field.
|
void |
validateFullName(String input,
org.springframework.validation.Errors errors)
Validates the user input for the fullName field.
|
void |
validateInput(String formField,
String input,
org.springframework.validation.Errors errors)
A generic utility method to validate user input against known bad characters and strings.
|
void |
validateSubCenter(int input,
org.springframework.validation.Errors errors)
Validates the user input for the sub center field.
|
void |
validateUserName(String input,
org.springframework.validation.Errors errors)
Validates the user input for the userName field.
|
public boolean supports(Class clazz)
supports in interface org.springframework.validation.Validatorpublic void validate(Object obj, org.springframework.validation.Errors errors)
validate in interface org.springframework.validation.Validatorobj - The target object to validate.error - Object in which to store any validation errors.public void validateUserName(String input, org.springframework.validation.Errors errors)
input - The user input to validate.error - Object in which to store any validation errors.public void validateFullName(String input, org.springframework.validation.Errors errors)
input - The user input to validate.error - Object in which to store any validation errors.public void validateCenter(int input,
org.springframework.validation.Errors errors)
input - The user input to validate.error - Object in which to store any validation errors.public void validateSubCenter(int input,
org.springframework.validation.Errors errors)
input - The user input to validate.error - Object in which to store any validation errors.public void validateEmailAddress(String input, org.springframework.validation.Errors errors)
input - The user input to validate.error - Object in which to store any validation errors.public void validateInput(String formField, String input, org.springframework.validation.Errors errors)
formField - The form field corresponding to the user input.input - The user input to validate.error - Object in which to store any validation errors.public String checkForNaughtyStrings(String itemToCheck)
itemToCheck - The user input to validate.Copyright © 1999-2013 UCAR/Unidata. All Rights Reserved.