Constructor and Description |
---|
ConceptDrugValidator() |
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 that a given
Drug object is valid. |
public boolean supports(Class<?> c)
supports
in interface org.springframework.validation.Validator
Should support Drug class
Should reject classes not extending Drug
public void validate(Object obj, org.springframework.validation.Errors errors) throws IllegalArgumentException
Drug
object is valid.validate
in interface org.springframework.validation.Validator
obj
- the Object to validateerrors
- holds the validation errorsIllegalArgumentException
- Runtime Exception if the supplied argument is
null or not of type Drug
Should fail if a concept is not specified
Copyright © 2024 OpenMRS Inc.. All rights reserved.