IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IKVM.Java.Externs.sun.reflect.Reflection Class Reference

Provides the implementations of the native methods in global::sun.reflect.Reflection. More...

Static Public Member Functions

static global::java.lang.Class getCallerClass ()
 
static global::java.lang.Class getCallerClass (int realFramesToSkip)
 
static int getClassAccessFlags (global::java.lang.Class clazz)
 
static bool checkInternalAccess (global::java.lang.Class currentClass, global::java.lang.Class memberClass)
 

Detailed Description

Provides the implementations of the native methods in global::sun.reflect.Reflection.

Definition at line 39 of file Reflection.cs.

Member Function Documentation

◆ checkInternalAccess()

static bool IKVM.Java.Externs.sun.reflect.Reflection.checkInternalAccess ( global.java.lang.Class currentClass,
global.java.lang.Class memberClass )
static

Definition at line 139 of file Reflection.cs.

140 {
141 var current = RuntimeJavaType.FromClass(currentClass);
142 var member = RuntimeJavaType.FromClass(memberClass);
143 return member.IsInternal && member.InternalsVisibleTo(current);
144 }

◆ getCallerClass() [1/2]

static global.java.lang.Class IKVM.Java.Externs.sun.reflect.Reflection.getCallerClass ( )
static

Definition at line 91 of file Reflection.cs.

92 {
93#if FIRST_PASS
94 throw new NotImplementedException();
95#else
96 throw new global::java.lang.InternalError("CallerSensitive annotation expected at frame 1");
97#endif
98 }

◆ getCallerClass() [2/2]

static global.java.lang.Class IKVM.Java.Externs.sun.reflect.Reflection.getCallerClass ( int realFramesToSkip)
static

Definition at line 102 of file Reflection.cs.

103 {
104#if FIRST_PASS
105 throw new NotImplementedException();
106#else
107 if (realFramesToSkip <= 0)
108 return (global::java.lang.Class)ClassLiteral<global::sun.reflect.Reflection>.Value;
109
110 for (int i = 2; ;)
111 {
112 var method = new StackFrame(i++, false).GetMethod();
113 if (method == null)
114 return null;
115
116 if (IsHideFromStackWalk(method))
117 continue;
118
119 // HACK we skip HideFromJavaFlags.StackTrace too because we want to skip the LambdaForm methods
120 // that are used by late binding
121 if ((GetHideFromJavaFlags(method) & HideFromJavaFlags.StackTrace) != 0)
122 continue;
123
124 if (--realFramesToSkip == 0)
125 return JVM.Context.ClassLoaderFactory.GetJavaTypeFromType(method.DeclaringType).ClassObject;
126 }
127#endif
128 }
Provides a static cache of java.lang.Class instances per .NET type.
static object Value
Gets the class literal value, caching the result.
Main state of the running JVM.
RuntimeClassLoaderFactory ClassLoaderFactory
Gets the RuntimeClassLoaderFactory associated with this instance of the runtime.

◆ getClassAccessFlags()

static int IKVM.Java.Externs.sun.reflect.Reflection.getClassAccessFlags ( global.java.lang.Class clazz)
static

Definition at line 130 of file Reflection.cs.

131 {
132 // the mask comes from JVM_RECOGNIZED_CLASS_MODIFIERS in src/hotspot/share/vm/prims/jvm.h
133 int mods = (int)RuntimeJavaType.FromClass(clazz).Modifiers & 0x7631;
134 // interface implies abstract
135 mods |= (mods & 0x0200) << 1;
136 return mods;
137 }

The documentation for this class was generated from the following file: