Class RequireVoidReasonVoidHandler

  extended by org.openmrs.api.handler.RequireVoidReasonVoidHandler
All Implemented Interfaces:
RequiredDataHandler<Voidable>, VoidHandler<Voidable>

public class RequireVoidReasonVoidHandler
extends java.lang.Object
implements VoidHandler<Voidable>

This class ensures that the voidReason is non-null for supported object types

See Also:
RequiredDataAdvice, UnvoidHandler

Constructor Summary
Method Summary
 void handle(Voidable voidableObject, User voidingUser, java.util.Date voidedDate, java.lang.String voidReason)
          Validates that the voidReason is non-null and non-empty for supported objects
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public RequireVoidReasonVoidHandler()
Method Detail


public void handle(Voidable voidableObject,
                   User voidingUser,
                   java.util.Date voidedDate,
                   java.lang.String voidReason)
Validates that the voidReason is non-null and non-empty for supported objects

Specified by:
handle in interface RequiredDataHandler<Voidable>
Specified by:
handle in interface VoidHandler<Voidable>
voidableObject - an OpenmrsObject that needs to have some required data set
voidingUser - the currently authenticated User
voidedDate - the current Date
voidReason - (optional) would be the second argument in the save/void/unvoid/etc method, if exists
See Also:
RequiredDataHandler.handle(org.openmrs.OpenmrsObject, org.openmrs.User, java.util.Date, java.lang.String)
Expected behavior:
throw IllegalArgumentException if Patient voidReason is null, throw IllegalArgumentException if Encounter voidReason is empty, throw IllegalArgumentException if Obs voidReason is blank, not throw Exception if voidReason is not blank, not throw Exception if voidReason is null for unsupported types


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