org.openmrs.api.handler
Class BaseUnvoidHandler

java.lang.Object
  extended by org.openmrs.api.handler.BaseUnvoidHandler
All Implemented Interfaces:
RequiredDataHandler<Voidable>, UnvoidHandler<Voidable>

@Handler(supports=Voidable.class)
public class BaseUnvoidHandler
extends java.lang.Object
implements UnvoidHandler<Voidable>

This is the super interface for all unvoid* 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 unvoid* method. If it is a unvoid* method, this class is called to handle setting the Voidable.isVoided(), Voidable.setVoidReason(String), Voidable#setVoiddBy(User), and Voidable#setDateVoidd(Date) all to null.

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

Since:
1.5
See Also:
RequiredDataAdvice, VoidHandler

Constructor Summary
BaseUnvoidHandler()
           
 
Method Summary
 void handle(Voidable voidableObject, User voidingUser, java.util.Date origParentVoidedDate, java.lang.String unused)
          Called around every unvoid* method to set everything to null.

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseUnvoidHandler

public BaseUnvoidHandler()
Method Detail

handle

public void handle(Voidable voidableObject,
                   User voidingUser,
                   java.util.Date origParentVoidedDate,
                   java.lang.String unused)
Called around every unvoid* method to set everything to null.

Specified by:
handle in interface RequiredDataHandler<Voidable>
Specified by:
handle in interface UnvoidHandler<Voidable>
Parameters:
voidableObject - an OpenmrsObject that needs to have some required data set
voidingUser - the currently authenticated User
origParentVoidedDate - the current Date
unused - (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:
unset the voided bit, unset the voider, unset the dateVoided, unset the voidReason, only act on already voided objects, not act on objects with a different dateVoided

OpenMRS-1.7.x

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