Package com.softwaremining.util
Class ReflectionUtils
java.lang.Object
com.softwaremining.util.ReflectionUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
invokeBooleanMethod
(Object instance, String methodName) Loads the class, instantiates it using its no-arg constructor, invokes the specified no-arg method, and returns the boolean result.
-
Constructor Details
-
ReflectionUtils
public ReflectionUtils()
-
-
Method Details
-
invokeBooleanMethod
public static boolean invokeBooleanMethod(Object instance, String methodName) throws ReflectiveOperationException Loads the class, instantiates it using its no-arg constructor, invokes the specified no-arg method, and returns the boolean result.- Parameters:
className
- fully-qualified name, e.g. "com.Xyz"methodName
- name of the method, e.g. "isTrue"- Returns:
- the boolean returned by the invoked method
- Throws:
ReflectiveOperationException
- if anything goes wrong with loading, instantiation, or invocation
-