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 boolean
isClassAvailable
(ClassLoader cl, String className) Deprecated.static Object
newInstance
(Class<?> clazz) static <T> T
newInstance
(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 givenClassLoader
can load a class.- Parameters:
cl
-ClassLoader
to useclassName
- to check- Returns:
true
if the class loader can load the class,false
otherwise
-
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.