Class ReflectionUtil
java.lang.Object
io.netty.util.internal.ReflectionUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic Class<?> resolveTypeParameter(Object object, Class<?> parametrizedSuperclass, String typeParamName) Resolve a type parameter of a class that is a subclass of the given parametrized superclass.static ThrowabletrySetAccessible(AccessibleObject object, boolean checkAccessible) Try to callAccessibleObject.setAccessible(boolean)but will catch anySecurityExceptionandInaccessibleObjectExceptionand return it.
-
Method Details
-
trySetAccessible
Try to callAccessibleObject.setAccessible(boolean)but will catch anySecurityExceptionandInaccessibleObjectExceptionand return it. The caller must check if it returnsnulland if not handle the returned exception. -
resolveTypeParameter
public static Class<?> resolveTypeParameter(Object object, Class<?> parametrizedSuperclass, String typeParamName) Resolve a type parameter of a class that is a subclass of the given parametrized superclass.- Parameters:
object- The object to resolve the type parameter forparametrizedSuperclass- The parametrized superclasstypeParamName- The name of the type parameter to resolve- Returns:
- The resolved type parameter
- Throws:
IllegalStateException- if the type parameter could not be resolved
-