Modifier and Type | Method and Description |
---|---|
static <T> Constructor<T> |
getAssignableConstructor(Class<T> clazz,
Class<?>... argumentTypes) |
static Constructor<?> |
getConstructor(Class<?> clazz,
Class<?>... argumentTypes)
Obtains the Constructor specified from the given Class and argument types
|
static List<Field> |
getFields(Class<?> source) |
static List<Field> |
getFieldsWithAnnotatedAnnotation(Class<?> source,
Class<? extends Annotation> annotationClass) |
static List<Field> |
getFieldsWithAnnotation(Class<?> source,
Class<? extends Annotation> annotationClass) |
static List<Method> |
getMethodsWithAnnotation(Class<?> source,
Class<? extends Annotation> annotationClass) |
static Class<?> |
getQualifier(Annotation[] annotations) |
static ClassLoader |
getThreadContextClassLoader()
Obtains the Thread Context ClassLoader
|
static boolean |
hasConstructor(Class<?> clazz,
Class<?>... argumentTypes) |
static boolean |
isClassPresent(String name) |
static <T> T |
newInstance(String className,
Class<?>[] argumentTypes,
Object[] arguments,
Class<T> expectedType)
Create a new instance by finding a constructor that matches the argumentTypes signature using the arguments for
instantiation.
|
public static ClassLoader getThreadContextClassLoader()
public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... argumentTypes) throws NoSuchMethodException
clazz
- argumentTypes
- NoSuchMethodException
public static <T> Constructor<T> getAssignableConstructor(Class<T> clazz, Class<?>... argumentTypes) throws NoSuchMethodException
NoSuchMethodException
public static <T> T newInstance(String className, Class<?>[] argumentTypes, Object[] arguments, Class<T> expectedType)
className
- Full classname of class to createargumentTypes
- The constructor argument typesarguments
- The constructor argumentsIllegalArgumentException
- if className, argumentTypes, or arguments are nullRuntimeException
- if any exceptions during creationpublic static boolean isClassPresent(String name)
public static List<Field> getFieldsWithAnnotation(Class<?> source, Class<? extends Annotation> annotationClass)
public static List<Field> getFieldsWithAnnotatedAnnotation(Class<?> source, Class<? extends Annotation> annotationClass)
public static List<Method> getMethodsWithAnnotation(Class<?> source, Class<? extends Annotation> annotationClass)
public static Class<?> getQualifier(Annotation[] annotations)
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.