Top Description Constructors Methods
org.codehaus.commons.compiler.util.reflect

public final Class Methods

extends Object
Class Inheritance
Imports
java.lang.reflect.InvocationTargetException, .Method, org.codehaus.commons.nullanalysis.Nullable

Utility methods related to Method.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <R, EX extends Throwable> R
invoke(Method method, Object obj, Object... args)

A wrapper for <var>method</var>.invoke(<var>obj</var>, <var>args</var>) that catches any exception, wraps it in an AssertionError, and throws that.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Methodsback to summary
private Methods()

Method Detail

invokeback to summary
public static <R, EX extends Throwable> R invoke(Method method, Object obj, Object... args) throws Object[]-:EX

A wrapper for <var>method</var>.invoke(<var>obj</var>, <var>args</var>) that catches any exception, wraps it in an AssertionError, and throws that.

Exceptions
Object[]-:EX:
The method threw that exception
ClassCastException:
  • The method threw an unchecked exception that is not a subclass of EX
  • The method returned a value that is not a subclass of R