|
||||||||||
| 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
| Constructor Summary | |
|---|---|
Reflections()
|
|
| Method Summary | ||
|---|---|---|
static boolean |
annotationSetMatches(java.util.Set<java.lang.annotation.Annotation> annotations,
java.lang.Class<? extends java.lang.annotation.Annotation>... annotationTypes)
Checks if all annotations are in a given set of annotations |
|
static boolean |
annotationTypeSetMatches(java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> annotations,
java.lang.Class<? extends java.lang.annotation.Annotation>... annotationTypes)
Checks if all annotations types are in a given set of annotations |
|
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
|
getAnnotatedConstructors(java.lang.Class<? extends T> clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets all constructors with a given annotation |
|
static
|
getConstructor(java.lang.Class<T> clazz,
java.lang.Class<?>... parameterTypes)
Gets a constructor with matching parameter types |
|
static
|
getConstructorsForAnnotatedParameter(java.lang.Class<? extends T> clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> parameterAnnotationType)
Gets constructors with a given annotated parameter |
|
static
|
getConstructorsForMetaAnnotatedParameter(java.lang.Class<? extends T> clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
Gets constructors with a given meta-annotated parameter |
|
static java.util.List<java.lang.reflect.Method> |
getMethods(java.lang.Class<?> clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets all methods with a given annotation |
|
static java.lang.String |
getPropertyName(java.lang.reflect.Method method)
Gets the property name from a getter method |
|
static java.util.Set<java.lang.Class<?>> |
getTypeHierachy(java.lang.Class<?> clazz)
Gets the type hierarchy for a class A recursive function that adds the class to the set of type and then calls itself with the suprerclass as paramater until the top of the hierarchy is reached. |
|
static void |
getTypeHierachy(java.lang.Class<?> clazz,
java.util.Set<? super java.lang.Class<?>> classes)
Gets the flattened type hierarchy for a class, including all super classes and the entire interface type hierarchy |
|
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 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 |
isBindingType(java.lang.annotation.Annotation bindingType)
Checks the bindingType to make sure the annotation was declared properly as a binding type (annotated with @BindingType). |
|
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 |
isStaticInnerClass(java.lang.Class<?> clazz)
Checks if class is a static inner one |
|
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 |
|
| 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 isStaticInnerClass(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> getConstructor(java.lang.Class<T> clazz,
java.lang.Class<?>... parameterTypes)
T - The typeclazz - The classparameterTypes - The parameter types
public static java.util.List<java.lang.reflect.Method> getMethods(java.lang.Class<?> clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
clazz - The class the examineannotationType - The annotation type to search for
public static <T> java.util.List<java.lang.reflect.Constructor<T>> getAnnotatedConstructors(java.lang.Class<? extends T> clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
T - The type of the classclazz - The classannotationType - The annotation type
public static <T> java.util.List<java.lang.reflect.Constructor<T>> getConstructorsForAnnotatedParameter(java.lang.Class<? extends T> clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> parameterAnnotationType)
T - The typeclazz - The classparameterAnnotationType - The parameter annotation type
public static <T> java.util.List<java.lang.reflect.Constructor<T>> getConstructorsForMetaAnnotatedParameter(java.lang.Class<? extends T> clazz,
java.lang.Class<? extends java.lang.annotation.Annotation> metaAnnotationType)
T - The typeclazz - The classmetaAnnotationType - The parameter meta-annotation type
public static boolean annotationTypeSetMatches(java.util.Set<java.lang.Class<? extends java.lang.annotation.Annotation>> annotations,
java.lang.Class<? extends java.lang.annotation.Annotation>... annotationTypes)
annotations - The annotation setannotationTypes - The annotation types to match
public static boolean annotationSetMatches(java.util.Set<java.lang.annotation.Annotation> annotations,
java.lang.Class<? extends java.lang.annotation.Annotation>... annotationTypes)
annotations - The annotation setannotationTypes - The annotations to match
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 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.reflect.Method lookupMethod(java.lang.reflect.Method method,
java.lang.Object instance)
method - The method to look forinstance - The instance to start from
public static boolean isProxy(java.lang.Object instance)
instance - The instance to examine
public static java.util.Set<java.lang.Class<?>> getTypeHierachy(java.lang.Class<?> clazz)
clazz - The class to examine
getTypeHierachy(Class, Set)
public static void getTypeHierachy(java.lang.Class<?> clazz,
java.util.Set<? super java.lang.Class<?>> classes)
clazz - the class to examineclasses - the set of typespublic static boolean isBindingType(java.lang.annotation.Annotation bindingType)
bindingType - 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 | |||||||||