org.jboss.errai.reflections
Class ReflectionUtils

java.lang.Object
  extended by org.jboss.errai.reflections.ReflectionUtils
Direct Known Subclasses:
Reflections

public abstract class ReflectionUtils
extends java.lang.Object

convenient reflection methods


Field Summary
static java.util.List<java.lang.String> primitiveDescriptors
           
static java.util.List<java.lang.String> primitiveNames
           
static java.util.List<java.lang.Class> primitiveTypes
           
 
Constructor Summary
ReflectionUtils()
           
 
Method Summary
protected static boolean areAnnotationMembersMatching(java.lang.annotation.Annotation annotation1, java.lang.reflect.AnnotatedElement annotatedElement)
          checks for annotation member values matching on an annotated element or it's first annotated super type, based on equality of members
static boolean areAnnotationMembersMatching(java.lang.annotation.Annotation annotation1, java.lang.annotation.Annotation annotation2)
          checks for annotation member values matching, based on equality of members
static java.lang.Class<?> forName(java.lang.String typeName, java.lang.ClassLoader... classLoaders)
          tries to resolve a java type name to a Class
static
<T> java.util.List<java.lang.Class<? extends T>>
forNames(java.lang.Iterable<java.lang.String> classes, java.lang.ClassLoader... classLoaders)
          try to resolve all given string representation of types to a list of java types
static
<T> java.util.Collection<? extends java.lang.Class<?>>
getAllSuperTypes(java.lang.Class<T> type)
           
static java.util.List<java.lang.reflect.AnnotatedElement> getAllSuperTypesAnnotatedWith(java.lang.reflect.AnnotatedElement annotatedElement, java.lang.annotation.Annotation annotation)
          return all super types of a given annotated element annotated with a given annotation up in hierarchy, including the given type
protected static
<T extends java.lang.reflect.AnnotatedElement>
java.util.Set<T>
getMatchingAnnotations(java.util.Set<T> annotatedElements, java.lang.annotation.Annotation annotation)
          returns a subset of given annotatedWith, where annotation member values matches the given annotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

primitiveNames

public static final java.util.List<java.lang.String> primitiveNames

primitiveTypes

public static final java.util.List<java.lang.Class> primitiveTypes

primitiveDescriptors

public static final java.util.List<java.lang.String> primitiveDescriptors
Constructor Detail

ReflectionUtils

public ReflectionUtils()
Method Detail

getAllSuperTypes

public static <T> java.util.Collection<? extends java.lang.Class<?>> getAllSuperTypes(java.lang.Class<T> type)

getAllSuperTypesAnnotatedWith

public static java.util.List<java.lang.reflect.AnnotatedElement> getAllSuperTypesAnnotatedWith(java.lang.reflect.AnnotatedElement annotatedElement,
                                                                                               java.lang.annotation.Annotation annotation)
return all super types of a given annotated element annotated with a given annotation up in hierarchy, including the given type


areAnnotationMembersMatching

public static boolean areAnnotationMembersMatching(java.lang.annotation.Annotation annotation1,
                                                   java.lang.annotation.Annotation annotation2)
checks for annotation member values matching, based on equality of members


areAnnotationMembersMatching

protected static boolean areAnnotationMembersMatching(java.lang.annotation.Annotation annotation1,
                                                      java.lang.reflect.AnnotatedElement annotatedElement)
checks for annotation member values matching on an annotated element or it's first annotated super type, based on equality of members


getMatchingAnnotations

protected static <T extends java.lang.reflect.AnnotatedElement> java.util.Set<T> getMatchingAnnotations(java.util.Set<T> annotatedElements,
                                                                                                        java.lang.annotation.Annotation annotation)
returns a subset of given annotatedWith, where annotation member values matches the given annotation


forName

public static java.lang.Class<?> forName(java.lang.String typeName,
                                         java.lang.ClassLoader... classLoaders)
tries to resolve a java type name to a Class

if optional ClassLoaders are not specified, then both ClasspathHelper.getContextClassLoader() and ClasspathHelper.getStaticClassLoader() are used


forNames

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



Copyright © 2011. All Rights Reserved.