@Handler(supports=PersonName.class, order=50) public class PersonNameValidator extends Object implements org.springframework.validation.Validator
Constructor and Description |
---|
PersonNameValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
supports(Class<?> c) |
void |
validate(Object object,
org.springframework.validation.Errors errors)
Checks whether person name has all required values, and whether values are proper length
|
void |
validatePersonName(PersonName personName,
org.springframework.validation.Errors errors,
boolean arrayInd,
boolean testInd)
Deprecated.
as of 2.2.0, use
validate(Object, Errors) |
public boolean supports(Class<?> c)
supports
in interface org.springframework.validation.Validator
Validator.supports(java.lang.Class)
public void validate(Object object, org.springframework.validation.Errors errors)
validate
in interface org.springframework.validation.Validator
object
- errors
- Should fail validation if PersonName object is null
Should pass validation if name is invalid but voided
Should pass validation if field lengths are correct
Should fail validation if field lengths are not correct@Deprecated public void validatePersonName(PersonName personName, org.springframework.validation.Errors errors, boolean arrayInd, boolean testInd)
validate(Object, Errors)
PersonName
is validpersonName
- the PersonName
to validateerrors
- arrayInd
- indicates whether or not a names[0] array needs to be prepended to field
Should fail validation if PersonName object is null
Should fail validation if PersonName.givenName is null
Should fail validation if PersonName.givenName is empty
Should fail validation if PersonName.givenName is just spaces
Should fail validation if PersonName.givenName is spaces surrounded by quotation marks
Should pass validation if PersonName.givenName is not blank
Should pass validation if PersonName.familyName is null
Should pass validation if PersonName.familyName is empty
Should pass validation if PersonName.familyName is just spaces
Should fail validation if PersonName.familyName is spaces surrounded by quotation marks
Should pass validation if PersonName.familyName is not blank
Should fail validation if PersonName.prefix is too long
Should pass validation if PersonName.prefix is exactly max length
Should pass validation if PersonName.prefix is less than maximum field length
Should fail validation if PersonName.givenName is too long
Should pass validation if PersonName.givenName is exactly max length
Should pass validation if PersonName.givenName is less than maximum field length
Should fail validation if PersonName.middleName is too long
Should pass validation if PersonName.middleName is exactly max length
Should pass validation if PersonName.middleName is less than maximum field length
Should fail validation if PersonName.familyNamePrefix is too long
Should pass validation if PersonName.familyNamePrefix is exactly max length
Should pass validation if PersonName.familyNamePrefix is less than maximum field length
Should fail validation if PersonName.familyName is too long
Should pass validation if PersonName.familyName is exactly max length
Should pass validation if PersonName.familyName is less than maximum field length
Should fail validation if PersonName.familyName2 is too long
Should pass validation if PersonName.familyName2 is exactly max length
Should pass validation if PersonName.familyName2 is less than maximum field length
Should fail validation if PersonName.familyNameSuffix is too long
Should pass validation if PersonName.familyNameSuffix is exactly max length
Should pass validation if PersonName.familyNameSuffix is less than maximum field length
Should fail validation if PersonName.degree is too long
Should pass validation if PersonName.degree is exactly max length
Should pass validation if PersonName.degree is less than maximum field length
Should fail validation if PersonName.givenName is invalid
Should pass validation if PersonName.givenName is valid
Should fail validation if PersonName.middleName is invalid
Should pass validation if PersonName.middleName is valid
Should fail validation if PersonName.familyName is invalid
Should pass validation if PersonName.familyName is valid
Should fail validation if PersonName.familyName2 is invalid
Should pass validation if PersonName.familyName2 is valid
Should pass validation if regex string is null
Should pass validation if regex string is empty
Should not validate against regex for blank namesCopyright © 2024 OpenMRS Inc.. All rights reserved.