@Handler(supports=OrderType.class) public class OrderTypeValidator extends Object implements org.springframework.validation.Validator
OrderType
class.Constructor and Description |
---|
OrderTypeValidator() |
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 Order 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 orderType object is null
Should fail if name is null
Should fail if name is empty
Should fail if name is whitespace
Should fail if name is a duplicate
Should fail if conceptClass is a duplicate
Should fail if parent is among its descendants
Should fail if parent is also a direct child
Should pass if all fields are correct for a new order type
Should pass if all fields are correct for an existing order type
Should be invoked when an order type is saved
Should pass validation if field lengths are correct
Should fail validation if field lengths are not correct
Copyright © 2024 OpenMRS Inc.. All rights reserved.