Package org.apache.sshd.common.util
Class ReflectionUtils
java.lang.Object
org.apache.sshd.common.util.ReflectionUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Field> getMatchingDeclaredFields(Class<?> clazz, Predicate<? super Field> acceptor) static Collection<Field> getMatchingFields(Class<?> clazz, Predicate<? super Field> acceptor) static booleanisClassAvailable(ClassLoader cl, String className) Deprecated.static ObjectnewInstance(Class<?> clazz) static <T> TnewInstance(Class<?> clazz, Class<? extends T> castType)
-
Field Details
-
FIELD_NAME_EXTRACTOR
-
-
Constructor Details
-
ReflectionUtils
private ReflectionUtils()
-
-
Method Details
-
getMatchingFields
public static Collection<Field> getMatchingFields(Class<?> clazz, Predicate<? super Field> acceptor) -
getMatchingDeclaredFields
public static Collection<Field> getMatchingDeclaredFields(Class<?> clazz, Predicate<? super Field> acceptor) -
isClassAvailable
Deprecated.The preferred method isThreadUtils.resolveDefaultClass(Class, String)which checks all possible ClassLoaders.Checks whether a givenClassLoadercan load a class.- Parameters:
cl-ClassLoaderto useclassName- to check- Returns:
trueif the class loader can load the class,falseotherwise
-
newInstance
- Throws:
ReflectiveOperationException
-
newInstance
public static <T> T newInstance(Class<?> clazz, Class<? extends T> castType) throws ReflectiveOperationException - Throws:
ReflectiveOperationException
-
ThreadUtils.resolveDefaultClass(Class, String)which checks all possible ClassLoaders.