@Nullable public static <RETURNTYPE> RETURNTYPE invokeMethod (@Nonnull final Object aSrcObj, @Nonnull final String sMethodName, @Nullable final Class <?> [] aArgClasses, @Nullable final Object [] aArgs) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { final Method aMethod = aSrcObj.getClass ().getDeclaredMethod (sMethodName, aArgClasses); final Object aReturn = aMethod.invoke (aSrcObj, aArgs); return GenericReflection.<Object, RETURNTYPE> uncheckedCast (aReturn); }
@Nullable public static <RETURNTYPE> RETURNTYPE invokeStaticMethod (@Nonnull final Class <?> aClass, @Nonnull final String sMethodName, @Nullable final Object... aArgs) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { return GenericReflection.<RETURNTYPE> invokeStaticMethod (aClass, sMethodName, getClassArray (aArgs), aArgs); }