Class ClassReflect

  • All Implemented Interfaces:
    ClassReflect

    public class ClassReflect
    extends java.lang.Object
    implements ClassReflect
    The implementation for using ZEL. Notice that it is instantiated in zel.jar.
    Author:
    tomyeh
    • Constructor Summary

      Constructors 
      Constructor Description
      ClassReflect()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.reflect.Method getCloseMethod​(java.lang.Class<?> cls, java.lang.String name, java.lang.Class<?>[] argTypes)
      Gets one of the close methods -- a close method is a method with the same name and the compatible argument type.
      java.lang.ClassLoader getContextClassLoader​(java.lang.Class<?> reference)
      Returns the context ClassLoader for the reference class.
      java.lang.Object newInstance​(java.lang.Class<?> cls, java.lang.Object[] args)
      Instantiates a new instance of the specified class with the specified argument.
      • Methods inherited from class java.lang.Object

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

      • ClassReflect

        public ClassReflect()
    • Method Detail

      • getCloseMethod

        public java.lang.reflect.Method getCloseMethod​(java.lang.Class<?> cls,
                                                       java.lang.String name,
                                                       java.lang.Class<?>[] argTypes)
                                                throws java.lang.NoSuchMethodException
        Gets one of the close methods -- a close method is a method with the same name and the compatible argument type.
        Specified by:
        getCloseMethod in interface ClassReflect
        Throws:
        java.lang.NoSuchMethodException
      • newInstance

        public java.lang.Object newInstance​(java.lang.Class<?> cls,
                                            java.lang.Object[] args)
                                     throws java.lang.NoSuchMethodException,
                                            java.lang.InstantiationException,
                                            java.lang.reflect.InvocationTargetException,
                                            java.lang.IllegalAccessException
        Instantiates a new instance of the specified class with the specified argument.
        Specified by:
        newInstance in interface ClassReflect
        Throws:
        java.lang.NoSuchMethodException
        java.lang.InstantiationException
        java.lang.reflect.InvocationTargetException
        java.lang.IllegalAccessException
      • getContextClassLoader

        public java.lang.ClassLoader getContextClassLoader​(java.lang.Class<?> reference)
        Returns the context ClassLoader for the reference class.
        Specified by:
        getContextClassLoader in interface ClassReflect
        Parameters:
        reference - the reference class where it is invoked from.
        Since:
        8.0.2