@Handler(supports=Location.class, order=50) public class LocationValidator extends BaseCustomizableValidator implements org.springframework.validation.Validator
Constructor and Description |
---|
LocationValidator() |
Modifier and Type | Method and Description |
---|---|
boolean |
supports(Class<?> c)
Determines if the command object being submitted is a valid type
|
void |
validate(Object obj,
org.springframework.validation.Errors errors)
Checks the form object for any inconsistencies/errors
|
validateAttributes
public boolean supports(Class<?> c)
supports
in interface org.springframework.validation.Validator
Validator.supports(java.lang.Class)
public void validate(Object obj, org.springframework.validation.Errors errors)
validate
in interface org.springframework.validation.Validator
Should fail validation if name is null or empty
Should fail validation if retired and retireReason is null or empty
Should set retired to false if retireReason is null or empty
Should pass validation if all fields are correct
Should pass validation if retired location is given retired reason
Should fail validation if parent location creates a loop
Should fail validation if name is exist in non retired locations
Should pass validation if field lengths are correct
Should fail validation if field lengths are not correct
Copyright © 2024 OpenMRS Inc.. All rights reserved.