Package com.sun.ts.lib.util.sec.reflect
Class Reflection
java.lang.Object
com.sun.ts.lib.util.sec.reflect.Reflection
Common utility routines used by both java.lang and java.lang.reflect
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidensureMemberAccess(Class currentClass, Class memberClass, Object target, int modifiers) static Field[]filterFields(Class containingClass, Field[] fields) static Method[]filterMethods(Class containingClass, Method[] methods) static ClassgetCallerClass(int realFramesToSkip) Returns the class of the methodrealFramesToSkipframes up the stack (zero-based), ignoring frames associated with java.lang.reflect.Method.invoke() and its implementation.static booleanquickCheckMemberAccess(Class memberClass, int modifiers) A quick "fast-path" check to try to avoid getCallerClass() calls.static voidregisterFieldsToFilter(Class containingClass, String... fieldNames) static voidregisterMethodsToFilter(Class containingClass, String... methodNames) static booleanverifyMemberAccess(Class currentClass, Class memberClass, Object target, int modifiers)
-
Constructor Details
-
Reflection
public Reflection()
-
-
Method Details
-
getCallerClass
Returns the class of the methodrealFramesToSkipframes up the stack (zero-based), ignoring frames associated with java.lang.reflect.Method.invoke() and its implementation. The first frame is that associated with this method, sogetCallerClass(0)returns the Class object for sun.reflect.Reflection. Frames associated with java.lang.reflect.Method.invoke() and its implementation are completely ignored and do not count toward the number of "real" frames skipped. -
quickCheckMemberAccess
A quick "fast-path" check to try to avoid getCallerClass() calls. -
ensureMemberAccess
public static void ensureMemberAccess(Class currentClass, Class memberClass, Object target, int modifiers) throws IllegalAccessException - Throws:
IllegalAccessException
-
verifyMemberAccess
-
registerFieldsToFilter
-
registerMethodsToFilter
-
filterFields
-
filterMethods
-