Class ReflectionUtils


  • public final class ReflectionUtils
    extends java.lang.Object
    Utilities that make easier to cope with Java Reflection.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object invokeFieldable​(ExecutionContext context, java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Object target, java.lang.Object[] args)
      Invokes a method.
      static java.lang.Object invokeFieldable​(ExecutionContext context, java.lang.reflect.Method toInvoke, java.lang.Object target, java.lang.Object[] args)
      Invokes a method.
      • Methods inherited from class java.lang.Object

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

      • invokeFieldable

        public static java.lang.Object invokeFieldable​(ExecutionContext context,
                                                       java.lang.Class<?> clazz,
                                                       java.lang.String methodName,
                                                       java.lang.Object target,
                                                       java.lang.Object[] args)
        Invokes a method. If there are fields involved, field operations are applied
        Parameters:
        context - the current ExecutionContext
        clazz - the class to search for a method
        methodName - the name of the method
        target - the target object (can be null in case of static invocation)
        args - the arguments for the method
        Returns:
        the result of the method invocation
      • invokeFieldable

        public static java.lang.Object invokeFieldable​(@Nonnull
                                                       ExecutionContext context,
                                                       @Nonnull
                                                       java.lang.reflect.Method toInvoke,
                                                       @Nullable
                                                       java.lang.Object target,
                                                       @Nonnull
                                                       java.lang.Object[] args)
        Invokes a method. If there are fields involved, field operations are applied
        Parameters:
        context - the current ExecutionContext
        toInvoke - the method to be invoked
        target - the target object (can be null in case of static invocation)
        args - the arguments for the method
        Returns:
        the result of the method invocation