IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IkvmReflectionSymbolContext.cs
Go to the documentation of this file.
1using System;
3
13using Type = IKVM.Reflection.Type;
14
16{
17
22 {
23
24 readonly ConditionalWeakTable<Assembly, IkvmReflectionAssemblySymbol> _assemblies = new();
25
30 {
31
32 }
33
40 {
41 if (assembly is null)
42 throw new ArgumentNullException(nameof(assembly));
43
44 return _assemblies.GetValue(assembly, _ => new IkvmReflectionAssemblySymbol(this, _));
45 }
46
53 {
54 if (module is null)
55 throw new ArgumentNullException(nameof(module));
56
57 return GetOrCreateAssemblySymbol(module.Assembly).GetOrCreateModuleSymbol(module);
58 }
59
66 {
67 if (type is null)
68 throw new ArgumentNullException(nameof(type));
69
70 return GetOrCreateModuleSymbol(type.Module).GetOrCreateTypeSymbol(type);
71 }
72
79 {
80 if (ctor is null)
81 throw new ArgumentNullException(nameof(ctor));
82
83 return GetOrCreateAssemblySymbol(ctor.Module.Assembly).GetOrCreateModuleSymbol(ctor.Module).GetOrCreateTypeSymbol(ctor.DeclaringType!).GetOrCreateConstructorSymbol(ctor);
84 }
85
92 {
93 if (method is null)
94 throw new ArgumentNullException(nameof(method));
95
96 return GetOrCreateAssemblySymbol(method.Module.Assembly).GetOrCreateModuleSymbol(method.Module).GetOrCreateTypeSymbol(method.DeclaringType!).GetOrCreateMethodSymbol(method);
97 }
98
105 {
106 if (parameter is null)
107 throw new ArgumentNullException(nameof(parameter));
108
109 return GetOrCreateAssemblySymbol(parameter.Member.Module.Assembly).GetOrCreateModuleSymbol(parameter.Member.Module).GetOrCreateTypeSymbol(parameter.Member.DeclaringType!).GetOrCreateMethodBaseSymbol((MethodBase)parameter.Member).GetOrCreateParameterSymbol(parameter);
110 }
111
118 {
119 if (field is null)
120 throw new ArgumentNullException(nameof(field));
121
122 return GetOrCreateAssemblySymbol(field.Module.Assembly).GetOrCreateModuleSymbol(field.Module).GetOrCreateTypeSymbol(field.DeclaringType!).GetOrCreateFieldSymbol(field);
123 }
124
131 {
132 if (property is null)
133 throw new ArgumentNullException(nameof(property));
134
135 return GetOrCreateAssemblySymbol(property.Module.Assembly).GetOrCreateModuleSymbol(property.Module).GetOrCreateTypeSymbol(property.DeclaringType!).GetOrCreatePropertySymbol(property);
136 }
137
144 {
145 if (@event is null)
146 throw new ArgumentNullException(nameof(@event));
147
148 return GetOrCreateAssemblySymbol(@event.Module.Assembly).GetOrCreateModuleSymbol(@event.Module).GetOrCreateTypeSymbol(@event.DeclaringType!).GetOrCreateEventSymbol(@event);
149 }
150
151 }
152
153}
IKVM.Reflection.Module Module
IKVM.Reflection.Type Type
IKVM.Reflection.Assembly Assembly
IKVM.Reflection.ConstructorInfo ConstructorInfo
IKVM.Reflection.EventInfo EventInfo
IKVM.Reflection.FieldInfo FieldInfo
IKVM.Reflection.PropertyInfo PropertyInfo
IKVM.Reflection.MethodInfo MethodInfo
IKVM.Reflection.ParameterInfo ParameterInfo
IKVM.Reflection.MethodBase MethodBase
Implementation of IModuleSymbol derived from System.Reflection.
Holds references to symbols derived from System.Reflection.
IkvmReflectionEventSymbol GetOrCreateEventSymbol(EventInfo @event)
Gets or creates a IkvmReflectionEventSymbol for the specified EventInfo.
IkvmReflectionFieldSymbol GetOrCreateFieldSymbol(FieldInfo field)
Gets or creates a IkvmReflectionFieldSymbol for the specified FieldInfo.
IkvmReflectionParameterSymbol GetOrCreateParameterSymbol(ParameterInfo parameter)
Gets or creates a IkvmReflectionParameterSymbol for the specified ParameterInfo.
IkvmReflectionAssemblySymbol GetOrCreateAssemblySymbol(Assembly assembly)
Gets or creates a IkvmReflectionAssemblySymbol for the specified Assembly.
IkvmReflectionTypeSymbol GetOrCreateTypeSymbol(Type type)
Gets or creates a IkvmReflectionTypeSymbol for the specified Type.
IkvmReflectionPropertySymbol GetOrCreatePropertySymbol(PropertyInfo property)
Gets or creates a IkvmReflectionPropertySymbol for the specified PropertyInfo.
IkvmReflectionMethodSymbol GetOrCreateMethodSymbol(MethodInfo method)
Gets or creates a IkvmReflectionMethodBaseSymbol for the specified MethodInfo.
IkvmReflectionModuleSymbol GetOrCreateModuleSymbol(Module module)
Gets or creates a IkvmReflectionModuleSymbol for the specified Module.
IkvmReflectionConstructorSymbol GetOrCreateConstructorSymbol(ConstructorInfo ctor)
Gets or creates a IkvmReflectionConstructorSymbol for the specified ConstructorInfo.