| 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 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 - NoSuchMethodExceptionpublic static <T> Constructor<T> getAssignableConstructor(Class<T> clazz, Class<?>... argumentTypes) throws NoSuchMethodException
NoSuchMethodExceptionpublic 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)
Copyright © 2016 JBoss by Red Hat. All rights reserved.