org.openmrs.api.handler
Class OpenmrsObjectSaveHandler

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

@Handler(supports=OpenmrsObject.class)
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.

Since:
1.5
See Also:
RequiredDataHandler, SaveHandler

Constructor Summary
OpenmrsObjectSaveHandler()
           
 
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

OpenmrsObjectSaveHandler

public OpenmrsObjectSaveHandler()
Method Detail

handle

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>
Parameters:
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)

OpenMRS-1.7.x

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