org.seasar.framework.util.tiger
クラス ReflectionUtil

java.lang.Object
  上位を拡張 org.seasar.framework.util.tiger.ReflectionUtil

public abstract class ReflectionUtil
extends Object

作成者:
koichik

メソッドの概要
static
<T> Class<T>
forName(String className)
           
static
<T> Class<T>
forName(String className, ClassLoader loader)
           
static
<T> Class<T>
forNameNoException(String className)
           
static
<T> Class<T>
forNameNoException(String className, ClassLoader loader)
           
static
<T> Constructor<T>
getConstructor(Class<T> clazz, Class... argTypes)
           
static
<T> Constructor<T>
getDeclaredConstructor(Class<T> clazz, Class... argTypes)
           
static Field getDeclaredField(Class<?> clazz, String name)
           
static Method getDeclaredMethod(Class<?> clazz, String name, Class... argTypes)
           
static Class<?> getElementTypeOfList(Type parameterizedList)
           
static Class<?> getElementTypeOfListFromParameterType(Method method, int parameterPosition)
           
static Class<?> getElementTypeOfListFromReturnType(Method method)
           
static Field getField(Class<?> clazz, String name)
           
static Method getMethod(Class<?> clazz, String name, Class... argTypes)
           
static
<T> T
getStaticValue(Field field)
           
static
<T> T
getValue(Field field, Object target)
           
static
<T> T
invoke(Method method, Object target, Object... args)
           
static
<T> T
invokeStatic(Method method, Object... args)
           
static
<T> T
newInstance(Class<T> clazz)
           
static
<T> T
newInstance(Constructor<T> constructor, Object... args)
           
static void setStaticValue(Field field, Object value)
           
static void setValue(Field field, Object target, Object value)
           
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

forName

public static <T> Class<T> forName(String className)
                        throws ClassNotFoundRuntimeException
例外:
ClassNotFoundRuntimeException

forName

public static <T> Class<T> forName(String className,
                                   ClassLoader loader)
                        throws ClassNotFoundRuntimeException
例外:
ClassNotFoundRuntimeException

forNameNoException

public static <T> Class<T> forNameNoException(String className)
                                   throws ClassNotFoundRuntimeException
例外:
ClassNotFoundRuntimeException

forNameNoException

public static <T> Class<T> forNameNoException(String className,
                                              ClassLoader loader)
                                   throws ClassNotFoundRuntimeException
例外:
ClassNotFoundRuntimeException

getConstructor

public static <T> Constructor<T> getConstructor(Class<T> clazz,
                                                Class... argTypes)

getDeclaredConstructor

public static <T> Constructor<T> getDeclaredConstructor(Class<T> clazz,
                                                        Class... argTypes)

getField

public static Field getField(Class<?> clazz,
                             String name)

getDeclaredField

public static Field getDeclaredField(Class<?> clazz,
                                     String name)

getMethod

public static Method getMethod(Class<?> clazz,
                               String name,
                               Class... argTypes)

getDeclaredMethod

public static Method getDeclaredMethod(Class<?> clazz,
                                       String name,
                                       Class... argTypes)

newInstance

public static <T> T newInstance(Class<T> clazz)
                     throws InstantiationRuntimeException,
                            IllegalAccessRuntimeException
例外:
InstantiationRuntimeException
IllegalAccessRuntimeException

newInstance

public static <T> T newInstance(Constructor<T> constructor,
                                Object... args)
                     throws InstantiationRuntimeException,
                            IllegalAccessRuntimeException
例外:
InstantiationRuntimeException
IllegalAccessRuntimeException

getValue

public static <T> T getValue(Field field,
                             Object target)

getStaticValue

public static <T> T getStaticValue(Field field)

setValue

public static void setValue(Field field,
                            Object target,
                            Object value)

setStaticValue

public static void setStaticValue(Field field,
                                  Object value)

invoke

public static <T> T invoke(Method method,
                           Object target,
                           Object... args)

invokeStatic

public static <T> T invokeStatic(Method method,
                                 Object... args)

getElementTypeOfList

public static Class<?> getElementTypeOfList(Type parameterizedList)

getElementTypeOfListFromParameterType

public static Class<?> getElementTypeOfListFromParameterType(Method method,
                                                             int parameterPosition)

getElementTypeOfListFromReturnType

public static Class<?> getElementTypeOfListFromReturnType(Method method)


Copyright © 2005-2007 The Seasar Foundation. All Rights Reserved.