public final class ReflectionUtils extends Object
Modifier and Type | Field and Description |
---|---|
static Function<Field,String> |
FIELD_NAME_EXTRACTOR |
Modifier and Type | Method and Description |
---|---|
static Collection<Field> |
getMatchingDeclaredFields(Class<?> clazz,
Predicate<? super Field> acceptor) |
static Collection<Field> |
getMatchingFields(Class<?> clazz,
Predicate<? super Field> acceptor) |
static boolean |
isClassAvailable(ClassLoader cl,
String className)
Deprecated.
The preferred method is
ThreadUtils.resolveDefaultClass(Class, String)
which checks all possible ClassLoaders. |
static Object |
newInstance(Class<?> clazz) |
static <T> T |
newInstance(Class<?> clazz,
Class<? extends T> castType) |
public static Collection<Field> getMatchingFields(Class<?> clazz, Predicate<? super Field> acceptor)
public static Collection<Field> getMatchingDeclaredFields(Class<?> clazz, Predicate<? super Field> acceptor)
@Deprecated public static boolean isClassAvailable(ClassLoader cl, String className)
ThreadUtils.resolveDefaultClass(Class, String)
which checks all possible ClassLoaders.ClassLoader
can load a class.cl
- ClassLoader
to useclassName
- to checktrue
if the class loader can load the class, false
otherwisepublic static Object newInstance(Class<?> clazz) throws ReflectiveOperationException
ReflectiveOperationException
public static <T> T newInstance(Class<?> clazz, Class<? extends T> castType) throws ReflectiveOperationException
ReflectiveOperationException
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.