| 
 |   | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openmrs.util.HandlerUtil
public class HandlerUtil
Utility class that provides useful methods for working with classes that are annotated with the
 Handler annotation
| Constructor Summary | |
|---|---|
| HandlerUtil() | |
| Method Summary | ||
|---|---|---|
| static
 | getHandlersForType(java.lang.Class<H> handlerType,
                   java.lang.Class<T> type)Retrieves a List of all registered components from the Context that are of the passed handlerType and one or more of the following is true: The handlerType is annotated as a Handlerthat supports the passed type
 The passed type is null - this effectively returns all components of the passed
 handlerType
 
 The returned handlers are ordered in the list based upon the order property. | |
| static java.lang.Integer | getOrderOfHandler(java.lang.Class<?> handlerClass)Utility method to return the order attribute of the Handlerannotation on the passed
 class. | |
| static
 | getPreferredHandler(java.lang.Class<H> handlerType,
                    java.lang.Class<T> type)Retrieves the preferred Handler for a given handlerType and type. | |
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public HandlerUtil()
| Method Detail | 
|---|
public static <H,T> java.util.List<H> getHandlersForType(java.lang.Class<H> handlerType,
                                                         java.lang.Class<T> type)
Handler that supports the passed type
handlerType - Indicates the type of class to returntype - Indicates the type that the given handlerType must support (or null for any)
public static <H,T> H getPreferredHandler(java.lang.Class<H> handlerType,
                                          java.lang.Class<T> type)
handlerType - the class that is an annotated Handler to retrievetype - the class that the annotated Handler must support
public static java.lang.Integer getOrderOfHandler(java.lang.Class<?> handlerClass)
Handler annotation on the passed
 class. If the passed class does not have a Handler annotation, a RuntimeException is
 thrown
handlerClass - 
| 
 | OpenMRS-1.7.x | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||