Class OpenmrsObjectSaveHandler

  extended by org.openmrs.api.handler.OpenmrsObjectSaveHandler
All Implemented Interfaces:
RequiredDataHandler<OpenmrsObject>, SaveHandler<OpenmrsObject>

public class OpenmrsObjectSaveHandler
extends java.lang.Object
implements SaveHandler<OpenmrsObject>

This class deals with any object that implements OpenmrsObject. When an OpenmrsObject is saved (via a save* method in a service), this handler is automatically called by the RequiredDataAdvice AOP class.

This class sets the uuid property on the given OpenmrsObject to a randomly generated UUID if it is non-null.

See Also:
RequiredDataHandler, SaveHandler

Constructor Summary
Method Summary
 void handle(OpenmrsObject openmrsObject, User creator, java.util.Date dateCreated, java.lang.String reason)
          This sets the uuid property on the given OpenmrsObject if it is non-null.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public OpenmrsObjectSaveHandler()
Method Detail


public void handle(OpenmrsObject openmrsObject,
                   User creator,
                   java.util.Date dateCreated,
                   java.lang.String reason)
This sets the uuid property on the given OpenmrsObject if it is non-null.

Specified by:
handle in interface RequiredDataHandler<OpenmrsObject>
Specified by:
handle in interface SaveHandler<OpenmrsObject>
openmrsObject - an OpenmrsObject that needs to have some required data set
creator - the user who is saving this object
dateCreated - the datetime this object is being saved
reason - (optional) would be the second argument in the save method, if exists
See Also:
RequiredDataHandler.handle(org.openmrs.OpenmrsObject, org.openmrs.User, java.util.Date, java.lang.String)


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