Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jini.rio.bean
Class BeanHelper

    java.lang.Object
      org.jini.rio.bean.BeanHelper

    public class BeanHelper

extends Object

A utility class that assists in invoking bean lifecycle events, either using annotations or declared method names

Constructor Summary
`BeanHelper()`

Method Summary
`static Method` | `getAnnotatedMethod(Object bean, Class<? extends Annotation> annClass)`
`static Class` | `getMethodFirstParamType(Method method)`
`static Class` | `getMethodFirstParamType(String methodName, Object o)`
`static Object` | `invokeBeanMethod(Object bean, String methodName, Class[] classArgs, Object[] objectArgs)` Helper to invoke a method on the bean using reflection
`static void` | `invokeLifeCycle(Class<? extends Annotation> annClass, String methodName, Object bean)` Invoke a lifecycle method

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### BeanHelper

    public BeanHelper()

Method Detail

### invokeLifeCycle

    public static void invokeLifeCycle(Class<? extends Annotation> annClass,
                                       String methodName,
                                       Object bean)
                                throws Exception

  Invoke a lifecycle method

  Parameters:
    `annClass` - The annotation class to use
    `methodName` - The lifecycle method name to invoke if the annotation is not found
    `bean` - The bean to invoke methods on
  Throws:
    `Exception` - of errors occur

### invokeBeanMethod

    public static Object invokeBeanMethod(Object bean,
                                          String methodName,
                                          Class[] classArgs,
                                          Object[] objectArgs)
                                   throws Exception

  Helper to invoke a method on the bean using reflection

  Parameters:
    `bean` - The bean to act on
    `methodName` - The method name
    `classArgs` - Class arguments
    `objectArgs` - Object argument
  Returns:
    The result of dispatching the method
  Throws:
    `Exception` - If errors occur

### getMethodFirstParamType

    public static Class getMethodFirstParamType(String methodName,
                                                Object o)

### getMethodFirstParamType

    public static Class getMethodFirstParamType(Method method)

### getAnnotatedMethod

    public static Method getAnnotatedMethod(Object bean,
                                            Class<? extends Annotation> annClass)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Project Rio.