Class BaseUnvoidHandler

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

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.

See Also:
RequiredDataAdvice, VoidHandler

Constructor Summary
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


public BaseUnvoidHandler()
Method Detail


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>
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


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