Class Invoker


  • final class Invoker
    extends java.lang.Object
    Invokes method on objects using reflection.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Invoker()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T invoke​(java.lang.Class<?> objectClazz, java.lang.String staticMethod, java.lang.Class<?>[] argClasses, java.lang.Object[] args)
      Note: Ensure that argClasses and args have the same number of elements
      static <T> T invoke​(java.lang.Class<?> objectClazz, java.lang.String staticMethod, java.lang.Class<?> argClazz, java.lang.Object arg)  
      static <T> T invoke​(java.lang.Object object, java.lang.String method)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Invoker

        private Invoker()
    • Method Detail

      • invoke

        public static <T> T invoke​(java.lang.Class<?> objectClazz,
                                   java.lang.String staticMethod,
                                   java.lang.Class<?>[] argClasses,
                                   java.lang.Object[] args)
                            throws DependencyCollectionException
        Note: Ensure that argClasses and args have the same number of elements
        Parameters:
        objectClazz - the class of the static method
        staticMethod - the static method to call
        argClasses - the classes of the argument, used to select the right static method
        args - the actual arguments to be passed
        Returns:
        the result of the method invocation
        Throws:
        DependencyCollectionException - if any checked exception occurs