org.openmrs.api.handler
Interface VoidHandler<V extends Voidable>

All Superinterfaces:
RequiredDataHandler<V>
All Known Implementing Classes:
BaseVoidHandler, PersonVoidHandler, RequireVoidReasonVoidHandler

public interface VoidHandler<V extends Voidable>
extends RequiredDataHandler<V>

This is the super interface for all void* actions that take place on all services. The RequiredDataAdvice class uses AOP around each method in every service to check to see if its a void* method. If it is a void* method, this class is called to handle setting the Voidable.isVoided(), Voidable.setVoidReason(String), Voidable#setVoiddBy(User), and Voidable#setDateVoidd(Date).

Child collections on this Voidable that are themselves a Voidable are looped over and also voided by the RequiredDataAdvice class.

Since:
1.5
See Also:
RequiredDataAdvice, UnvoidHandler

Method Summary
 void handle(V voidableObject, User voidingUser, java.util.Date voidedDate, java.lang.String voidReason)
          Implementing classes should set all void attributes to the given parameters.
 

Method Detail

handle

void handle(V voidableObject,
            User voidingUser,
            java.util.Date voidedDate,
            java.lang.String voidReason)
Implementing classes should set all void attributes to the given parameters.

Specified by:
handle in interface RequiredDataHandler<V extends Voidable>
Parameters:
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)

OpenMRS-1.7.x

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