Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013

ch.unibe.iam.scg.archie.utils
Class ProviderHelper

java.lang.Object
  extended by ch.unibe.iam.scg.archie.utils.ProviderHelper

public class ProviderHelper
extends java.lang.Object

Utility class providing helper functions for data providers. This class provides convenience methods for annotation retrieval and sorting. This class also handles the retrieval and setting of annotation methods and values for a given provider.

$Id$


Constructor Summary
ProviderHelper()
           
 
Method Summary
static java.util.Map<java.lang.String,java.lang.Object> getGetterMap(AbstractDataProvider provider, boolean sorted)
          Returns a map of getter methods for providers mapped from the method's name to it's value.
static java.util.ArrayList<java.lang.reflect.Method> getGetterMethods(AbstractDataProvider provider, boolean sorted)
          Convenient method to retrieve all getters from a given provider.
static java.util.ArrayList<java.lang.reflect.Method> getSetterMethods(AbstractDataProvider provider, boolean sorted)
          Convenient method to retrieve all setters from a given provider.
static java.lang.Object getValue(java.lang.reflect.Method method, AbstractDataProvider provider)
          Retrieves the value of a given method for a given provider by invoking the method on the given provider.
static void setValue(AbstractDataProvider provider, java.lang.reflect.Method method, java.lang.Object value)
          Sets the value of a given method for a given provider by invoking the method on the given provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProviderHelper

public ProviderHelper()
Method Detail

getGetterMap

public static java.util.Map<java.lang.String,java.lang.Object> getGetterMap(AbstractDataProvider provider,
                                                                            boolean sorted)
Returns a map of getter methods for providers mapped from the method's name to it's value.

Parameters:
provider - AbstractDataProvider to retrieve the methods from.
sorted - If true, the methods will be sorted according to their index.
Returns:
Map with getter method names and values.

getGetterMethods

public static java.util.ArrayList<java.lang.reflect.Method> getGetterMethods(AbstractDataProvider provider,
                                                                             boolean sorted)
Convenient method to retrieve all getters from a given provider.

Parameters:
provider - AbstractDataProvider to retrieve the methods from.
sorted - If true, the methods will be sorted according to their index.
Returns:
List of getter methods for a given provider.

getSetterMethods

public static java.util.ArrayList<java.lang.reflect.Method> getSetterMethods(AbstractDataProvider provider,
                                                                             boolean sorted)
Convenient method to retrieve all setters from a given provider.

Parameters:
provider - AbstractDataProvider to retrieve the methods from.
sorted - If true, the methods will be sorted according to their index.
Returns:
List of setter methods for a given provider.

getValue

public static java.lang.Object getValue(java.lang.reflect.Method method,
                                        AbstractDataProvider provider)
Retrieves the value of a given method for a given provider by invoking the method on the given provider.

Parameters:
method - Method to invoke.
provider - Provider where the method will be invoked.
Returns:
Value of the method invoked.

setValue

public static void setValue(AbstractDataProvider provider,
                            java.lang.reflect.Method method,
                            java.lang.Object value)
                     throws java.lang.Exception
Sets the value of a given method for a given provider by invoking the method on the given provider.

Parameters:
method - Method to invoke.
provider - Provider where the method will be invoked.
value - Value to use for the method invocation.
Throws:
java.lang.Exception - Exception when the value count not be set invoking the method on the given provider.

Elexis: Das führende OpenSource-Arztpraxisprogamm
im deutschsprachigen Raum
Java doc für Elexis version 2.1.7.dev vom 01.09.2013