org.ektorp.util
Class ReflectionUtils

java.lang.Object
  extended by org.ektorp.util.ReflectionUtils

public class ReflectionUtils
extends java.lang.Object


Nested Class Summary
static interface ReflectionUtils.AnnotationPredicate
           
 
Constructor Summary
ReflectionUtils()
           
 
Method Summary
static
<T extends java.lang.annotation.Annotation>
void
eachAnnotation(java.lang.Class<?> clazz, java.lang.Class<T> annotationClass, Predicate<T> p)
           
static java.util.Collection<java.lang.reflect.Field> eachField(java.lang.Class<?> clazz, Predicate<java.lang.reflect.Field> p)
           
static java.util.Collection<java.lang.reflect.Method> eachMethod(java.lang.Class<?> clazz, Predicate<java.lang.reflect.Method> p)
           
static
<T extends java.lang.annotation.Annotation>
T
findAnnotation(java.lang.Class<?> clazz, java.lang.Class<T> annotationClass, Predicate<java.lang.reflect.Field> p)
           
static java.lang.reflect.Method findMethod(java.lang.Class<?> clazz, java.lang.String name)
          Ignores case when comparing method names
static boolean hasAnnotation(java.lang.reflect.AnnotatedElement e, java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionUtils

public ReflectionUtils()
Method Detail

findAnnotation

public static <T extends java.lang.annotation.Annotation> T findAnnotation(java.lang.Class<?> clazz,
                                                                           java.lang.Class<T> annotationClass,
                                                                           Predicate<java.lang.reflect.Field> p)

eachField

public static java.util.Collection<java.lang.reflect.Field> eachField(java.lang.Class<?> clazz,
                                                                      Predicate<java.lang.reflect.Field> p)

eachMethod

public static java.util.Collection<java.lang.reflect.Method> eachMethod(java.lang.Class<?> clazz,
                                                                        Predicate<java.lang.reflect.Method> p)

eachAnnotation

public static <T extends java.lang.annotation.Annotation> void eachAnnotation(java.lang.Class<?> clazz,
                                                                              java.lang.Class<T> annotationClass,
                                                                              Predicate<T> p)

findMethod

public static java.lang.reflect.Method findMethod(java.lang.Class<?> clazz,
                                                  java.lang.String name)
Ignores case when comparing method names

Parameters:
clazz -
name -
Returns:

hasAnnotation

public static boolean hasAnnotation(java.lang.reflect.AnnotatedElement e,
                                    java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)


Copyright © 2011. All Rights Reserved.