com.liferay.portal.kernel.util
Class ReflectionUtil

java.lang.Object
  extended by com.liferay.portal.kernel.util.ReflectionUtil

public class ReflectionUtil
extends java.lang.Object

Author:
Brian Wing Shun Chan, Miguel Pastor, Shuyang Zhou

Constructor Summary
ReflectionUtil()
           
 
Method Summary
static java.lang.Class<?> getAnnotationDeclaringClass(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.Class<?> clazz)
           
protected static java.lang.reflect.Method getBridgeMethod(boolean publicMethod, java.lang.Class<?> clazz, java.lang.String name, java.lang.Class<?>... parameterTypes)
           
static java.lang.reflect.Method getBridgeMethod(java.lang.Class<?> clazz, java.lang.String name, java.lang.Class<?>... parameterTypes)
           
static java.lang.reflect.Method getDeclaredBridgeMethod(java.lang.Class<?> clazz, java.lang.String name, java.lang.Class<?>... parameterTypes)
           
static java.lang.reflect.Field getDeclaredField(java.lang.Class<?> clazz, java.lang.String name)
           
static java.lang.reflect.Method getDeclaredMethod(java.lang.Class<?> clazz, java.lang.String name, java.lang.Class<?>... parameterTypes)
           
static java.lang.Class<?>[] getInterfaces(java.lang.Object object)
           
static java.lang.Class<?>[] getInterfaces(java.lang.Object object, java.lang.ClassLoader classLoader)
           
static java.lang.Class<?>[] getParameterTypes(java.lang.Object[] arguments)
           
static boolean isAnnotationDeclaredInClass(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass, java.lang.Class<?> clazz)
           
static
<T extends java.lang.Enum<T>>
T
newEnumElement(java.lang.Class<T> enumClass, java.lang.Class<?>[] constructorParameterTypes, java.lang.String name, int ordinal, java.lang.Object... constructorParameters)
           
static
<T extends java.lang.Enum<T>>
T
newEnumElement(java.lang.Class<T> enumClass, java.lang.String name, int ordinal)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionUtil

public ReflectionUtil()
Method Detail

getAnnotationDeclaringClass

public static java.lang.Class<?> getAnnotationDeclaringClass(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass,
                                                             java.lang.Class<?> clazz)

getBridgeMethod

public static java.lang.reflect.Method getBridgeMethod(java.lang.Class<?> clazz,
                                                       java.lang.String name,
                                                       java.lang.Class<?>... parameterTypes)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

getDeclaredBridgeMethod

public static java.lang.reflect.Method getDeclaredBridgeMethod(java.lang.Class<?> clazz,
                                                               java.lang.String name,
                                                               java.lang.Class<?>... parameterTypes)
                                                        throws java.lang.Exception
Throws:
java.lang.Exception

getDeclaredField

public static java.lang.reflect.Field getDeclaredField(java.lang.Class<?> clazz,
                                                       java.lang.String name)
                                                throws java.lang.Exception
Throws:
java.lang.Exception

getDeclaredMethod

public static java.lang.reflect.Method getDeclaredMethod(java.lang.Class<?> clazz,
                                                         java.lang.String name,
                                                         java.lang.Class<?>... parameterTypes)
                                                  throws java.lang.Exception
Throws:
java.lang.Exception

getInterfaces

public static java.lang.Class<?>[] getInterfaces(java.lang.Object object)

getInterfaces

public static java.lang.Class<?>[] getInterfaces(java.lang.Object object,
                                                 java.lang.ClassLoader classLoader)

getParameterTypes

public static java.lang.Class<?>[] getParameterTypes(java.lang.Object[] arguments)

isAnnotationDeclaredInClass

public static boolean isAnnotationDeclaredInClass(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass,
                                                  java.lang.Class<?> clazz)

newEnumElement

public static <T extends java.lang.Enum<T>> T newEnumElement(java.lang.Class<T> enumClass,
                                                             java.lang.Class<?>[] constructorParameterTypes,
                                                             java.lang.String name,
                                                             int ordinal,
                                                             java.lang.Object... constructorParameters)
                                                  throws java.lang.Exception
Throws:
java.lang.Exception

newEnumElement

public static <T extends java.lang.Enum<T>> T newEnumElement(java.lang.Class<T> enumClass,
                                                             java.lang.String name,
                                                             int ordinal)
                                                  throws java.lang.Exception
Throws:
java.lang.Exception

getBridgeMethod

protected static java.lang.reflect.Method getBridgeMethod(boolean publicMethod,
                                                          java.lang.Class<?> clazz,
                                                          java.lang.String name,
                                                          java.lang.Class<?>... parameterTypes)
                                                   throws java.lang.Exception
Throws:
java.lang.Exception