@Handler(supports=Drug.class) public class DrugValidator extends Object implements org.springframework.validation.Validator
Drug
objects.Constructor and Description |
---|
DrugValidator() |
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)
Validates an Drug object
|
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 if the drug object is null
Should fail if drug on drugReferenceMap is null
Should fail if conceptReferenceTerm on drugReferenceMap is null
Should invoke ConceptReferenceTermValidator if term on drugReferenceMap is new
Should invoke ConceptMapTypeValidator if conceptMapType on drugReferenceMap is new
Should pass if all fields are correct
Should reject drug multiple mappings to the same term
Should pass validation if field lengths are correct
Should fail validation if field lengths are not correct
Copyright © 2024 OpenMRS Inc.. All rights reserved.