IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
CoreClasses.cs
Go to the documentation of this file.
1/*
2 Copyright (C) 2004-2015 Jeroen Frijters
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 Jeroen Frijters
21 jeroen@frijters.net
22
23*/
24
25namespace IKVM.Runtime
26{
27
31 internal class CoreClasses
32 {
33
34 readonly RuntimeContext context;
35
36 RuntimeJavaType typeOfCliSystemObject;
37 RuntimeJavaType typeOfCliSystemException;
38 RuntimeJavaType typeOfIkvmInternalCallerID;
39 RuntimeJavaType typeOfJavaIoSerializable;
40 RuntimeJavaType typeOfJavaLangObject;
41 RuntimeJavaType typeOfJavaLangString;
42 RuntimeJavaType typeOfJavaLangClass;
43 RuntimeJavaType typeOfJavaLangCloneable;
44 RuntimeJavaType typeOfjavaLangThrowable;
45 RuntimeJavaType typeOfJavaLangInvokeMethodHandle;
46 RuntimeJavaType typeOfJavaLangInvokeMethodType;
47
52 public CoreClasses(RuntimeContext context)
53 {
54 this.context = context;
55 }
56
57 public RuntimeJavaType TypeOfCliSystemObject => typeOfCliSystemObject ??= context.ManagedJavaTypeFactory.GetJavaTypeFromManagedType(context.Types.Object);
58
59 public RuntimeJavaType TypeOfCliSystemException => typeOfCliSystemException ??= context.ManagedJavaTypeFactory.GetJavaTypeFromManagedType(context.Types.Exception);
60
61 public RuntimeJavaType TypeOfIkvmInternalCallerID => typeOfIkvmInternalCallerID ??= context.ClassLoaderFactory.LoadClassCritical("ikvm.internal.CallerID");
62
63 public RuntimeJavaType TypeOfJavaIoSerializable => typeOfJavaIoSerializable ??= context.ClassLoaderFactory.LoadClassCritical("java.io.Serializable");
64
65 public RuntimeJavaType TypeOfJavaLangObject => typeOfJavaLangObject ??= context.ClassLoaderFactory.LoadClassCritical("java.lang.Object");
66
67 public RuntimeJavaType TypeOfJavaLangString => typeOfJavaLangString ??= context.ClassLoaderFactory.LoadClassCritical("java.lang.String");
68
69 public RuntimeJavaType TypeOfJavaLangClass => typeOfJavaLangClass ??= context.ClassLoaderFactory.LoadClassCritical("java.lang.Class");
70
71 public RuntimeJavaType TypeOfJavaLangCloneable => typeOfJavaLangCloneable ??= context.ClassLoaderFactory.LoadClassCritical("java.lang.Cloneable");
72
73 public RuntimeJavaType TypeOfjavaLangThrowable => typeOfjavaLangThrowable ??= context.ClassLoaderFactory.LoadClassCritical("java.lang.Throwable");
74
75 public RuntimeJavaType TypeOfJavaLangInvokeMethodHandle => typeOfJavaLangInvokeMethodHandle ??= context.ClassLoaderFactory.LoadClassCritical("java.lang.invoke.MethodHandle");
76
77 public RuntimeJavaType TypeOfJavaLangInvokeMethodType => typeOfJavaLangInvokeMethodType ??= context.ClassLoaderFactory.LoadClassCritical("java.lang.invoke.MethodType");
78
79 }
80
81}