57 return type.IsSpecialName && type.Name.StartsWith(
NestedTypeName.IntrinsifiedAnonymousClass, StringComparison.Ordinal) && context.
AttributeHelper.IsJavaModule(type.Module);
65 internal override RuntimeClassLoader ClassLoader => Context.ClassLoaderFactory.GetJavaTypeFromType(type.DeclaringType).ClassLoader;
67 internal override Type TypeAsTBD
72 internal override RuntimeJavaType BaseTypeWrapper
74 get {
return Context.
JavaBase.TypeOfJavaLangObject; }
77 internal override RuntimeJavaType[] Interfaces
81 var interfaces = GetImplementedInterfacesAsTypeWrappers(Context, type);
82 if (type.IsSerializable)
85 var list =
new List<RuntimeJavaType>(interfaces);
87 return list.ToArray();
96 var methods =
new List<RuntimeJavaMethod>();
97 foreach (var mi
in type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly))
103 else if (mi.IsPublic)
105 GetSig(mi, out var returnType, out var parameterTypes, out var signature);
108 else if (mi.Name ==
"writeReplace")
114 SetMethods(methods.ToArray());
116 var fields =
new List<RuntimeJavaField>();
117 foreach (var fi
in type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly))
123 SetFields(fields.ToArray());
126 void GetSig(
MethodInfo mi, out RuntimeJavaType returnType, out RuntimeJavaType[] parameterTypes, out
string signature)
129 var parameters = mi.GetParameters();
130 parameterTypes =
new RuntimeJavaType[parameters.Length];
132 var sb =
new ValueStringBuilder(256);
134 for (
int i = 0; i < parameters.Length; i++)
137 sb.Append(parameterTypes[i].SigName);
140 sb.Append(returnType.SigName);
141 signature = sb.ToString();
Maintains services relevant to an instane of the IKVM runtime.
AttributeHelper AttributeHelper
Gets the AttributeHelper associated with this instance of the runtime.
Serialization Serialization
Gets the Serialization associated with this instance of the runtime.
CoreClasses JavaBase
Gets the CoreClasses associated with this instance of the runtime.
RuntimeClassLoaderFactory ClassLoaderFactory
Gets the RuntimeClassLoaderFactory associated with this instance of the runtime.