Class ReflectionUtils

java.lang.Object
com.softwaremining.util.ReflectionUtils

public class ReflectionUtils extends Object
  • 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