Class ReflectiveMethodCallUtil


  • @Deprecated
    public class ReflectiveMethodCallUtil
    extends java.lang.Object
    Deprecated.
    This logic is now implemented in ReflectionExecutor
    This ReflectiveMethodCallUtil can execute a method call on a given class reflectively. If the call fails, a RuntimeException is thrown, otherwise, a new Value is returned using the given factory.
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.lang.Object callConstructor​(java.lang.String className, java.lang.Class<?>[] parameterClasses, java.lang.Object[] parameterObjects)
      Deprecated.
      Reflectively call the constructor of className with the given parameters.
      static java.lang.Object callMethod​(java.lang.String className, java.lang.String methodName, java.lang.Object instance, java.lang.Class<?>[] parameterClasses, java.lang.Object[] parameterObjects)
      Deprecated.
      Reflectively call the method on the given instance.
      static java.lang.Class<?> getClassForArray​(java.lang.String internalArrayType)
      Deprecated.
       
      static java.lang.Class<?> getClassForPrimitive​(char internalPrimitiveType)
      Deprecated.
      Returns the Class for the given primitive type.
      static java.lang.Object getObjectForValue​(Value value, java.lang.Class<?> expectedType)
      Deprecated.
      Extract the Object from the given Value.
      static java.lang.Class<?>[] stringtypesToClasses​(java.lang.String descriptor)
      Deprecated.
      Reflectively converts a method descriptor to a list of Classes representing this String.
      • Methods inherited from class java.lang.Object

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

      • ReflectiveMethodCallUtil

        public ReflectiveMethodCallUtil()
        Deprecated.
    • Method Detail

      • stringtypesToClasses

        public static java.lang.Class<?>[] stringtypesToClasses​(java.lang.String descriptor)
                                                         throws java.lang.ClassNotFoundException
        Deprecated.
        Reflectively converts a method descriptor to a list of Classes representing this String.
        Throws:
        java.lang.ClassNotFoundException - if one of the referenced classes (as string) is not part of the current class pool.
      • getObjectForValue

        public static java.lang.Object getObjectForValue​(Value value,
                                                         java.lang.Class<?> expectedType)
        Deprecated.
        Extract the Object from the given Value.
        Parameters:
        value - the value holding the object.
        expectedType - the class the returned object should be.
        Returns:
        an object extracted from the value, or null if it could not be extracted.
      • getClassForArray

        public static java.lang.Class<?> getClassForArray​(java.lang.String internalArrayType)
        Deprecated.
      • getClassForPrimitive

        public static java.lang.Class<?> getClassForPrimitive​(char internalPrimitiveType)
        Deprecated.
        Returns the Class for the given primitive type.
      • callConstructor

        public static java.lang.Object callConstructor​(java.lang.String className,
                                                       java.lang.Class<?>[] parameterClasses,
                                                       java.lang.Object[] parameterObjects)
                                                throws java.lang.ClassNotFoundException,
                                                       java.lang.NoSuchMethodException,
                                                       java.lang.IllegalAccessException,
                                                       java.lang.reflect.InvocationTargetException,
                                                       java.lang.InstantiationException
        Deprecated.
        Reflectively call the constructor of className with the given parameters.
        Throws:
        java.lang.ClassNotFoundException
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
        java.lang.InstantiationException
      • callMethod

        public static java.lang.Object callMethod​(java.lang.String className,
                                                  java.lang.String methodName,
                                                  java.lang.Object instance,
                                                  java.lang.Class<?>[] parameterClasses,
                                                  java.lang.Object[] parameterObjects)
                                           throws java.lang.reflect.InvocationTargetException,
                                                  java.lang.IllegalAccessException,
                                                  java.lang.NoSuchMethodException,
                                                  java.lang.ClassNotFoundException
        Deprecated.
        Reflectively call the method on the given instance. Instance can be null for static methods.
        Throws:
        java.lang.reflect.InvocationTargetException
        java.lang.IllegalAccessException
        java.lang.NoSuchMethodException
        java.lang.ClassNotFoundException