|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openmrs.validator.ValidateUtil
public class ValidateUtil
This class should be used in the *Services to validate objects before saving them.
The validators are added to this class in the spring applicationContext-service.xml file.
Example usage:
public Order saveOrder(order) {
ValidateUtil.validate(order);
dao.saveOrder(order);
}
| Constructor Summary | |
|---|---|
ValidateUtil()
|
|
| Method Summary | |
|---|---|
protected static java.util.List<org.springframework.validation.Validator> |
getValidators(java.lang.Object obj)
Fetches all validators that are registered |
void |
setValidators(java.util.List<org.springframework.validation.Validator> newValidators)
Deprecated. in favor of using HandlerUtil to reflexively get validators |
static void |
validate(java.lang.Object obj)
Test the given object against all validators that are registered as compatible with the object class |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ValidateUtil()
| Method Detail |
|---|
@Deprecated public void setValidators(java.util.List<org.springframework.validation.Validator> newValidators)
newValidators - the validators to setprotected static java.util.List<org.springframework.validation.Validator> getValidators(java.lang.Object obj)
obj - the object that will be validated
public static void validate(java.lang.Object obj)
throws APIException
obj - the object to validate
APIException - thrown if a binding exception occurs
|
OpenMRS-1.7.x | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||