org.reflections

Class ReflectionUtils

    • Constructor Detail

      • ReflectionUtils

        public ReflectionUtils()
    • Method Detail

      • getAllSuperTypes

        public static Set<Class<?>> getAllSuperTypes(Class<?> type,                             com.google.common.base.Predicate<? super Class<?>>... predicates)
        get all super types of given type, including, optionally filtered by predicates

        include Object.class if includeObject is true

      • getAllMethods

        public static Set<Method> getAllMethods(Class<?> type,                        com.google.common.base.Predicate<? super Method>... predicates)
        get all methods of given type, up the super class hierarchy, optionally filtered by predicates
      • getMethods

        public static Set<Method> getMethods(Class<?> t,                     com.google.common.base.Predicate<? super Method>... predicates)
        get methods of given type, optionally filtered by predicates
      • getAllConstructors

        public static Set<Constructor> getAllConstructors(Class<?> type,                                  com.google.common.base.Predicate<? super Constructor>... predicates)
        get all constructors of given type, up the super class hierarchy, optionally filtered by predicates
      • getConstructors

        public static Set<Constructor> getConstructors(Class<?> t,                               com.google.common.base.Predicate<? super Constructor>... predicates)
        get constructors of given type, optionally filtered by predicates
      • getAllFields

        public static Set<Field> getAllFields(Class<?> type,                      com.google.common.base.Predicate<? super Field>... predicates)
        get all fields of given type, up the super class hierarchy, optionally filtered by predicates
      • getFields

        public static Set<Field> getFields(Class<?> type,                   com.google.common.base.Predicate<? super Field>... predicates)
        get fields of given type, optionally filtered by predicates
      • getAllAnnotations

        public static <T extends AnnotatedElementSet<Annotation> getAllAnnotations(T type,                                                             com.google.common.base.Predicate<Annotation>... predicates)
        get all annotations of given type, up the super class hierarchy, optionally filtered by predicates
      • getAnnotations

        public static <T extends AnnotatedElementSet<Annotation> getAnnotations(T type,                                                          com.google.common.base.Predicate<Annotation>... predicates)
        get annotations of given type, optionally honorInherited, optionally filtered by predicates
      • getAll

        public static <T extends AnnotatedElementSet<T> getAll(Set<T> elements,                                         com.google.common.base.Predicate<? super T>... predicates)
        filter all given elements with predicates, if given
      • withName

        public static <T extends Member> com.google.common.base.Predicate<T> withName(String name)
        where member name equals given name
      • withPrefix

        public static <T extends Member> com.google.common.base.Predicate<T> withPrefix(String prefix)
        where member name startsWith given prefix
      • withPattern

        public static <T extends AnnotatedElement> com.google.common.base.Predicate<T> withPattern(String regex)
        where member's toString matches given regex

        for example:

          getAllMethods(someClass, withPattern("public void .*")) 

      • withAnnotation

        public static <T extends AnnotatedElement> com.google.common.base.Predicate<T> withAnnotation(Class<? extends Annotation> annotation)
        where element is annotated with given annotation
      • withAnnotations

        public static <T extends AnnotatedElement> com.google.common.base.Predicate<T> withAnnotations(Class<? extends Annotation>... annotations)
        where element is annotated with given annotations
      • withAnnotation

        public static <T extends AnnotatedElement> com.google.common.base.Predicate<T> withAnnotation(Annotation annotation)
        where element is annotated with given annotation, including member matching
      • withAnnotations

        public static <T extends AnnotatedElement> com.google.common.base.Predicate<T> withAnnotations(Annotation... annotations)
        where element is annotated with given annotations, including member matching
      • withParameters

        public static com.google.common.base.Predicate<Member> withParameters(Class<?>... types)
        when method/constructor parameter types equals given types
      • withParametersAssignableTo

        public static com.google.common.base.Predicate<Member> withParametersAssignableTo(Class... types)
        when member parameter types assignable to given types
      • withParametersCount

        public static com.google.common.base.Predicate<Member> withParametersCount(int count)
        when method/constructor parameters count equal given count
      • withAnyParameterAnnotation

        public static com.google.common.base.Predicate<Member> withAnyParameterAnnotation(Class<? extends Annotation> annotationClass)
        when method/constructor has any parameter with an annotation matches given annotations
      • withAnyParameterAnnotation

        public static com.google.common.base.Predicate<Member> withAnyParameterAnnotation(Annotation annotation)
        when method/constructor has any parameter with an annotation matches given annotations, including member matching
      • withType

        public static <T> com.google.common.base.Predicate<Field> withType(Class<T> type)
        when field type equal given type
      • withTypeAssignableTo

        public static <T> com.google.common.base.Predicate<Field> withTypeAssignableTo(Class<T> type)
        when field type assignable to given type
      • withReturnType

        public static <T> com.google.common.base.Predicate<Method> withReturnType(Class<T> type)
        when method return type equal given type
      • withReturnTypeAssignableTo

        public static <T> com.google.common.base.Predicate<Method> withReturnTypeAssignableTo(Class<T> type)
        when method return type assignable from given type
      • withModifier

        public static <T extends Member> com.google.common.base.Predicate<T> withModifier(int mod)
        when member modifier matches given mod

        for example:

         withModifier(Modifier.PUBLIC) 

      • withClassModifier

        public static com.google.common.base.Predicate<Class<?>> withClassModifier(int mod)
        when class modifier matches given mod

        for example:

         withModifier(Modifier.PUBLIC) 

      • forNames

        public static <T> List<Class<? extends T>> forNames(Iterable<String> classes,                                    ClassLoader... classLoaders)
        try to resolve all given string representation of types to a list of java types

Copyright © 2015. All rights reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14