Package org.jboss.weld.environment.util
Class Reflections
java.lang.Object
org.jboss.weld.environment.util.Reflections
Reflection utilities.
- Author:
- Pete Muir, Martin Kouba
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Tstatic <T> Class<T>classForName(org.jboss.weld.resources.spi.ResourceLoader resourceLoader, String className) First try to load a class using the specified ResourceLoader.static booleancontainsAnnotation(Class<?> javaClass, Class<? extends Annotation> requiredAnnotation) static booleancontainsAnnotations(Annotation[] annotations, Class<? extends Annotation> requiredAnnotation) static booleanhasBeanDefiningAnnotation(Class<?> clazz, Set<Class<? extends Annotation>> initialBeanDefiningAnnotations) static booleanhasBeanDefiningMetaAnnotationSpecified(Annotation[] annotations, Class<? extends Annotation> metaAnnotationType) static booleanisClassLoadable(org.jboss.weld.resources.spi.ResourceLoader resourceLoader, String className) static <T> Class<T>
-
Field Details
-
META_ANNOTATIONS
-
-
Method Details
-
containsAnnotation
public static boolean containsAnnotation(Class<?> javaClass, Class<? extends Annotation> requiredAnnotation) -
cast
-
isClassLoadable
public static boolean isClassLoadable(org.jboss.weld.resources.spi.ResourceLoader resourceLoader, String className) - Parameters:
resourceLoader-className-- Returns:
trueif a class with the given name can be loaded,falseotherwise- See Also:
-
loadClass
public static <T> Class<T> loadClass(org.jboss.weld.resources.spi.ResourceLoader resourceLoader, String className) - Parameters:
resourceLoader-className-- Returns:
- the loaded class or null if the given class cannot be loaded
- See Also:
-
classForName
public static <T> Class<T> classForName(org.jboss.weld.resources.spi.ResourceLoader resourceLoader, String className) First try to load a class using the specified ResourceLoader. If not successful, tryClass.forName(String)as a fallback.- Parameters:
resourceLoader-className-- Returns:
- the loaded class
-
hasBeanDefiningMetaAnnotationSpecified
public static boolean hasBeanDefiningMetaAnnotationSpecified(Annotation[] annotations, Class<? extends Annotation> metaAnnotationType) - Parameters:
annotations-metaAnnotationType-- Returns:
trueif any of the annotations specified has the given meta annotation type specified,falseotherwise
-
containsAnnotations
public static boolean containsAnnotations(Annotation[] annotations, Class<? extends Annotation> requiredAnnotation) -
hasBeanDefiningAnnotation
public static boolean hasBeanDefiningAnnotation(Class<?> clazz, Set<Class<? extends Annotation>> initialBeanDefiningAnnotations)
-