org.openmrs.validator
Class RequireNameValidator

java.lang.Object
  extended by org.openmrs.validator.RequireNameValidator
All Implemented Interfaces:
org.springframework.validation.Validator

public class RequireNameValidator
extends java.lang.Object
implements org.springframework.validation.Validator

Validates objects and requires that "name" be filled in. Used by other validators so that they don't have to check the name every time.

Since:
1.5

Constructor Summary
RequireNameValidator()
           
 
Method Summary
 boolean supports(java.lang.Class clz)
           
 void validate(java.lang.Object o, org.springframework.validation.Errors errors)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequireNameValidator

public RequireNameValidator()
Method Detail

supports

public boolean supports(java.lang.Class clz)
Specified by:
supports in interface org.springframework.validation.Validator
See Also:
Validator.supports(java.lang.Class)

validate

public void validate(java.lang.Object o,
                     org.springframework.validation.Errors errors)
Specified by:
validate in interface org.springframework.validation.Validator
See Also:
Validator.validate(java.lang.Object, org.springframework.validation.Errors)
Expected behavior:
fail validation if name is null or empty or whitespace, pass validation if name has proper value

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change