|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.webbeans.util.Reflections
public class Reflections
Utility class for static reflection-type operations
Nested Class Summary | |
---|---|
static class |
Reflections.HierarchyDiscovery
|
Constructor Summary | |
---|---|
Reflections()
|
Method Summary | ||
---|---|---|
static java.lang.reflect.Type[] |
getActualTypeArguments(java.lang.Class<?> clazz)
Gets the actual type arguments of a class |
|
static java.lang.Object |
getAndWrap(java.lang.reflect.Field field,
java.lang.Object target)
Gets value of a field and wraps exceptions |
|
static java.lang.Object |
getAndWrap(java.lang.String fieldName,
java.lang.Object target)
|
|
static
|
getDeclaredConstructor(java.lang.Class<T> clazz,
java.lang.Class<?>... parameterTypes)
Gets a constructor with matching parameter types |
|
static java.lang.String |
getPropertyName(java.lang.reflect.Method method)
Gets the property name from a getter method |
|
static java.lang.Object |
invokeAndWrap(java.lang.reflect.Method method,
java.lang.Object instance,
java.lang.Object... parameters)
Invokes a method and wraps exceptions |
|
static java.lang.Object |
invokeAndWrap(java.lang.String methodName,
java.lang.Object instance,
java.lang.Object... parameters)
|
|
static boolean |
isAbstract(java.lang.Class<?> clazz)
Checks if clazz is abstract |
|
static boolean |
isArrayType(java.lang.Class<?> rawType)
Checks if raw type is array type |
|
static boolean |
isBindings(java.lang.annotation.Annotation binding)
Deprecated. |
|
static boolean |
isFinal(java.lang.Class<?> clazz)
Checks if class is final |
|
static boolean |
isFinal(java.lang.reflect.Member member)
Checks if member is final |
|
static boolean |
isNonMemberInnerClass(java.lang.Class<?> clazz)
Checks if class is a non-static inner one |
|
static boolean |
isParameterizedType(java.lang.Class<?> type)
Checks if type is parameterized type |
|
static boolean |
isPrimitive(java.lang.Class<?> type)
Checks if type is primitive |
|
static boolean |
isProxy(java.lang.Object instance)
Indicates if an instance is a Javassist proxy |
|
static boolean |
isSerializable(java.lang.Class<?> clazz)
|
|
static boolean |
isStatic(java.lang.Class<?> type)
Checks if type is static |
|
static boolean |
isStatic(java.lang.reflect.Member member)
Checks if member is static |
|
static boolean |
isTransient(java.lang.reflect.Member member)
|
|
static boolean |
isTypeOrAnyMethodFinal(java.lang.Class<?> type)
Checks if type or member is final |
|
static java.lang.reflect.Method |
lookupMethod(java.lang.reflect.Method method,
java.lang.Object instance)
Looks up a method in the type hierarchy of an instance |
|
static java.lang.reflect.Method |
lookupMethod(java.lang.String methodName,
java.lang.Class<?>[] parameterTypes,
java.lang.Object instance)
Looks up a method in the type hierarchy of an instance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Reflections()
Method Detail |
---|
public static java.lang.String getPropertyName(java.lang.reflect.Method method)
method
- The getter method
public static boolean isFinal(java.lang.Class<?> clazz)
clazz
- The class to check
public static boolean isFinal(java.lang.reflect.Member member)
member
- The member to check
public static boolean isTypeOrAnyMethodFinal(java.lang.Class<?> type)
type
- Type or member
public static boolean isPrimitive(java.lang.Class<?> type)
type
- Type to check
public static boolean isStatic(java.lang.Class<?> type)
type
- Type to check
public static boolean isStatic(java.lang.reflect.Member member)
member
- Member to check
public static boolean isTransient(java.lang.reflect.Member member)
public static boolean isAbstract(java.lang.Class<?> clazz)
clazz
- Class to check
public static boolean isNonMemberInnerClass(java.lang.Class<?> clazz)
clazz
- Class to Check
public static <T> java.lang.reflect.Constructor<T> getDeclaredConstructor(java.lang.Class<T> clazz, java.lang.Class<?>... parameterTypes)
T
- The typeclazz
- The classparameterTypes
- The parameter types
public static java.lang.reflect.Type[] getActualTypeArguments(java.lang.Class<?> clazz)
clazz
- The class to examine
public static boolean isArrayType(java.lang.Class<?> rawType)
rawType
- The raw type to check
public static boolean isParameterizedType(java.lang.Class<?> type)
type
- The type to check
public static java.lang.Object invokeAndWrap(java.lang.reflect.Method method, java.lang.Object instance, java.lang.Object... parameters)
method
- The method to invokeinstance
- The instance to invoke onparameters
- The parameters
public static java.lang.Object invokeAndWrap(java.lang.String methodName, java.lang.Object instance, java.lang.Object... parameters)
public static java.lang.Object getAndWrap(java.lang.reflect.Field field, java.lang.Object target)
field
- The field to set ontarget
- The instance to set on
public static java.lang.Object getAndWrap(java.lang.String fieldName, java.lang.Object target)
public static java.lang.reflect.Method lookupMethod(java.lang.reflect.Method method, java.lang.Object instance)
method
- The method to look forinstance
- The instance to start from
java.lang.IllegalArgumentException
- if the method is not foundpublic static java.lang.reflect.Method lookupMethod(java.lang.String methodName, java.lang.Class<?>[] parameterTypes, java.lang.Object instance) throws java.lang.NoSuchMethodException
method
- The method to look forinstance
- The instance to start from
java.lang.NoSuchMethodException
- if the method is not foundpublic static boolean isProxy(java.lang.Object instance)
instance
- The instance to examine
@Deprecated public static boolean isBindings(java.lang.annotation.Annotation binding)
binding
- The binding type to check
public static boolean isSerializable(java.lang.Class<?> clazz)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |