org.ektorp.util
Class ReflectionUtils

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

public class ReflectionUtils
extends Object


Nested Class Summary
static interface ReflectionUtils.AnnotationPredicate
           
 
Constructor Summary
ReflectionUtils()
           
 
Method Summary
static
<T extends Annotation>
void
eachAnnotation(Class<?> clazz, Class<T> annotationClass, Predicate<T> p)
           
static Collection<Field> eachField(Class<?> clazz, Predicate<Field> p)
           
static Collection<Method> eachMethod(Class<?> clazz, Predicate<Method> p)
           
static
<T extends Annotation>
T
findAnnotation(Class<?> clazz, Class<T> annotationClass, Predicate<Field> p)
           
static Method findMethod(Class<?> clazz, String name)
          Ignores case when comparing method names
static boolean hasAnnotation(AnnotatedElement e, Class<? extends 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 Annotation> T findAnnotation(Class<?> clazz,
                                                      Class<T> annotationClass,
                                                      Predicate<Field> p)

eachField

public static Collection<Field> eachField(Class<?> clazz,
                                          Predicate<Field> p)

eachMethod

public static Collection<Method> eachMethod(Class<?> clazz,
                                            Predicate<Method> p)

eachAnnotation

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

findMethod

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

Parameters:
clazz -
name -
Returns:

hasAnnotation

public static boolean hasAnnotation(AnnotatedElement e,
                                    Class<? extends Annotation> annotationClass)


Copyright © 2011. All Rights Reserved.