FileDocCategorySizeDatePackage
AccountValidator.javaAPI DocExample1418Fri Dec 05 18:04:44 GMT 2003org.springframework.samples.jpetstore.domain.logic

AccountValidator

public class AccountValidator extends Object implements org.springframework.validation.Validator
author
Juergen Hoeller
since
01.12.2003

Fields Summary
Constructors Summary
Methods Summary
public booleansupports(java.lang.Class clazz)

		return Account.class.isAssignableFrom(clazz);
	
public voidvalidate(java.lang.Object obj, org.springframework.validation.Errors errors)

		ValidationUtils.rejectIfEmpty(errors, "firstName", "FIRST_NAME_REQUIRED", "First name is required.");
		ValidationUtils.rejectIfEmpty(errors, "lastName", "LAST_NAME_REQUIRED", "Last name is required.");
		ValidationUtils.rejectIfEmpty(errors, "email", "EMAIL_REQUIRED", "Email address is required.");
		ValidationUtils.rejectIfEmpty(errors, "phone", "PHONE_REQUIRED", "Phone number is required.");
		ValidationUtils.rejectIfEmpty(errors, "address1", "ADDRESS_REQUIRED", "Address (1) is required.");
		ValidationUtils.rejectIfEmpty(errors, "city", "CITY_REQUIRED", "City is required.");
		ValidationUtils.rejectIfEmpty(errors, "state", "STATE_REQUIRED", "State is required.");
		ValidationUtils.rejectIfEmpty(errors, "zip", "ZIP_REQUIRED", "ZIP is required.");
		ValidationUtils.rejectIfEmpty(errors, "country", "COUNTRY_REQUIRED", "Country is required.");