Package org.zkoss.zel.impl.util
Class ClassUtil
java.lang.Object
org.zkoss.zel.impl.util.ClassUtil
Class related utilities.
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final Class<?>forNameByThread(String clsName) Returns the Class object of the specified class name, using the current thread's context class loader.static final MethodgetCloseMethod(Class<?> cls, String name, Class<?>[] argTypes) Gets one of the close methods -- a close method is a method with the same name and the compatible argument type.static ClassLoadergetContextClassLoader(Class<?> reference) Returns the context ClassLoader for the reference class.static booleanisInstance(Object value, Class<?> clz) static final ObjectnewInstance(Class<?> cls, Object[] args) Instantiates a new instance of the specified class with the specified argument.
-
Constructor Details
-
ClassUtil
public ClassUtil()
-
-
Method Details
-
getCloseMethod
public static final Method getCloseMethod(Class<?> cls, String name, Class<?>[] argTypes) throws NoSuchMethodException Gets one of the close methods -- a close method is a method with the same name and the compatible argument type.- Throws:
NoSuchMethodException
-
newInstance
public static final Object newInstance(Class<?> cls, Object[] args) throws NoSuchMethodException, InstantiationException, InvocationTargetException, IllegalAccessException Instantiates a new instance of the specified class with the specified argument. -
forNameByThread
Returns the Class object of the specified class name, using the current thread's context class loader.- Throws:
ClassNotFoundException
-
getContextClassLoader
Returns the context ClassLoader for the reference class.Default: returns from the current thread.
Or specify the library property oforg.zkoss.lang.contextClassLoader.classin zk.xml to provide a customized class loader.- Parameters:
reference- the reference class where it is invoked from.- Since:
- 8.0.2
-
isInstance
-