Errai 3.0.1-SNAPSHOT

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 Object

convenient reflection methods


Field Summary
static List<String> primitiveDescriptors
           
static List<String> primitiveNames
           
static List<Class> primitiveTypes
           
 
Constructor Summary
ReflectionUtils()
           
 
Method Summary
protected static boolean areAnnotationMembersMatching(Annotation annotation1, 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(Annotation annotation1, Annotation annotation2)
          checks for annotation member values matching, based on equality of members
static Class<?> forName(String typeName, ClassLoader... classLoaders)
          tries to resolve a java type name to a Class
static
<T> Class<? extends T>[]
forNames(Iterable<String> classes, ClassLoader... classLoaders)
          try to resolve all given string representation of types to a list of java types
static
<T> Collection<? extends Class<?>>
getAllSuperTypes(Class<T> type)
           
static List<AnnotatedElement> getAllSuperTypesAnnotatedWith(AnnotatedElement annotatedElement, 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 AnnotatedElement>
Set<T>
getMatchingAnnotations(Set<T> annotatedElements, 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 List<String> primitiveNames

primitiveTypes

public static final List<Class> primitiveTypes

primitiveDescriptors

public static final List<String> primitiveDescriptors
Constructor Detail

ReflectionUtils

public ReflectionUtils()
Method Detail

getAllSuperTypes

public static <T> Collection<? extends Class<?>> getAllSuperTypes(Class<T> type)

getAllSuperTypesAnnotatedWith

public static List<AnnotatedElement> getAllSuperTypesAnnotatedWith(AnnotatedElement annotatedElement,
                                                                   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(Annotation annotation1,
                                                   Annotation annotation2)
checks for annotation member values matching, based on equality of members


areAnnotationMembersMatching

protected static boolean areAnnotationMembersMatching(Annotation annotation1,
                                                      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 AnnotatedElement> Set<T> getMatchingAnnotations(Set<T> annotatedElements,
                                                                            Annotation annotation)
returns a subset of given annotatedWith, where annotation member values matches the given annotation


forName

public static Class<?> forName(String typeName,
                               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> Class<? extends T>[] forNames(Iterable<String> classes,
                                                ClassLoader... classLoaders)
try to resolve all given string representation of types to a list of java types


Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.