38 throw new NotImplementedException();
40 return GetTypeWrapperFromObject(
JVM.Context, o).ClassObject;
44 internal static RuntimeJavaType GetTypeWrapperFromObject(
RuntimeContext context,
object o)
47 if (ghostType !=
null)
60 if (tw !=
null && (!tw.IsAbstract || tw.IsArray))
70 throw new NotImplementedException();
72 var t =
Type.GetTypeFromHandle(handle);
76 if (!IsVisibleAsClass(t))
81 return tw.ClassObject;
90 throw new NotImplementedException();
92 var t =
Type.GetTypeFromHandle(handle);
96 if (!IsVisibleAsClass(t))
101 return tw.MakeArrayType(rank).ClassObject;
110 throw new NotImplementedException();
115 type = type.GetElementType();
119 if (type.DeclaringType !=
null &&
JVM.Context.
AttributeHelper.IsGhostInterface(type.DeclaringType))
120 type = type.DeclaringType;
122 if (!IsVisibleAsClass(type))
130 wrapper = wrapper.MakeArrayType(rank);
132 return wrapper.ClassObject;
136 private static bool IsVisibleAsClass(
Type type)
138 while (type.HasElementType)
140 if (type.IsPointer || type.IsByRef)
144 type = type.GetElementType();
146 if (type.ContainsGenericParameters && !type.IsGenericTypeDefinition)
150 System.Reflection.Emit.TypeBuilder tb = type as
System.Reflection.Emit.TypeBuilder;
151 if (tb !=
null && !tb.IsCreated())
165 var wrapper = RuntimeJavaType.FromClass(classObject);
166 if (wrapper.IsRemapped && wrapper.IsFinal)
167 return wrapper.TypeAsTBD;
169 return wrapper.TypeAsBaseType;
179 var wrapper = RuntimeJavaType.FromClass(classObject);
182 if (wrapper.IsRemapped && wrapper.IsFinal)
183 return wrapper.TypeAsTBD;
185 return wrapper.TypeAsBaseType;
192 throw new NotImplementedException();
201 throw new NotImplementedException();
IKVM.Reflection.Type Type
static Exception mapException(Exception e)
static global::java.lang.Class getClassFromObject(object o)
static Type getInstanceTypeFromClass(global::java.lang.Class classObject)
Gets the underlying CLR Type instance.
static global::java.lang.Class getClassFromTypeHandle(RuntimeTypeHandle handle)
static Exception unmapException(Exception e)
static global::java.lang.Class getFriendlyClassFromType(Type type)
static Type getRuntimeTypeFromClass(global::java.lang.Class classObject)
Gets the underlying CLR Type instance resovled fully at runtime.
static global::java.lang.Class getClassFromTypeHandle(RuntimeTypeHandle handle, int rank)
Main state of the running JVM.
Maintains services relevant to an instane of the IKVM runtime.
AttributeHelper AttributeHelper
Gets the AttributeHelper associated with this instance of the runtime.
RuntimeManagedJavaTypeFactory ManagedJavaTypeFactory
Gets the RuntimeManagedJavaTypeFactory associated with this instance of the runtime.
ExceptionHelper ExceptionHelper
Gets the ExceptionHelper associated with this instance of the runtime.
RuntimeClassLoaderFactory ClassLoaderFactory
Gets the RuntimeClassLoaderFactory associated with this instance of the runtime.
RuntimeJavaType GetJavaTypeFromManagedType(Type type)
Gets the RuntimeJavaType associated with the specified managed type, or creates one on demand.