org.zkoss.zel.impl.util
Class ClassUtil

java.lang.Object
  extended by org.zkoss.zel.impl.util.ClassUtil

public class ClassUtil
extends java.lang.Object

Class related utilities.

Author:
tomyeh

Constructor Summary
ClassUtil()
           
 
Method Summary
static java.lang.Class<?> forNameByThread(java.lang.String clsName)
          Returns the Class object of the specified class name, using the current thread's context class loader.
static 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.
static boolean isInstance(java.lang.Object value, java.lang.Class<?> clz)
           
static 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

ClassUtil

public ClassUtil()
Method Detail

getCloseMethod

public static final 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.

Throws:
java.lang.NoSuchMethodException

newInstance

public static final 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.

Throws:
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException

forNameByThread

public static final java.lang.Class<?> forNameByThread(java.lang.String clsName)
                                                throws java.lang.ClassNotFoundException
Returns the Class object of the specified class name, using the current thread's context class loader.

Throws:
java.lang.ClassNotFoundException

isInstance

public static boolean isInstance(java.lang.Object value,
                                 java.lang.Class<?> clz)


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo