Package com.igormaznitsa.jbbp.utils
Class ReflectUtils
java.lang.Object
com.igormaznitsa.jbbp.utils.ReflectUtils
Auxiliary class collects methods for work with reflection.
- Since:
- 1.4.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisPotentiallyAccessibleClass(Class<?> klazz) static booleanstatic <T extends AccessibleObject>
TmakeAccessible(T obj) Make accessible an accessible object, AccessController.doPrivileged will be called.static <T> TnewInstance(Class<T> klazz) Create class instance through default constructor call
-
Method Details
-
isPotentiallyAccessibleClass
-
isPotentiallyAccessibleField
-
makeAccessible
Make accessible an accessible object, AccessController.doPrivileged will be called.- Type Parameters:
T- type of object- Parameters:
obj- an object to make accessible, it can be null.- Returns:
- the same object
- See Also:
-
newInstance
Create class instance through default constructor call- Type Parameters:
T- type of the class- Parameters:
klazz- class to be instantiated, must not be null- Returns:
- instance of class, must not be null
- Throws:
RuntimeException- if can't create instance for an error
-