IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
ResourceModule.cs
Go to the documentation of this file.
1/*
2 Copyright (C) 2009-2011 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*/
24using System;
25using System.Collections.Generic;
26
28{
29
31 {
32
33 readonly ModuleReader manifest;
34 readonly int index;
35 readonly string location;
36
43 internal ResourceModule(ModuleReader manifest, int index, string location) :
44 base(manifest.Universe)
45 {
46 this.manifest = manifest;
47 this.index = index;
48 this.location = location;
49 }
50
51 public override int MDStreamVersion
52 {
53 get { throw new NotSupportedException(); }
54 }
55
56 public override bool IsResource()
57 {
58 return true;
59 }
60
61 public override Assembly Assembly
62 {
63 get { return manifest.Assembly; }
64 }
65
66 public override string FullyQualifiedName
67 {
68 get { return location ?? "<Unknown>"; }
69 }
70
71 public override string Name
72 {
73 get { return location == null ? "<Unknown>" : System.IO.Path.GetFileName(location); }
74 }
75
76 public override string ScopeName
77 {
78 get { return manifest.GetString(manifest.FileTable.records[index].Name); }
79 }
80
81 public override Guid ModuleVersionId
82 {
83 get { throw new NotSupportedException(); }
84 }
85
86 public override byte[] __ModuleHash
87 {
88 get
89 {
90 var blob = manifest.FileTable.records[index].HashValue;
91 return blob.IsNil ? Array.Empty<byte>() : manifest.GetBlobCopy(blob);
92 }
93 }
94
95 internal override Type FindType(TypeName typeName)
96 {
97 return null;
98 }
99
100 internal override Type FindTypeIgnoreCase(TypeName lowerCaseName)
101 {
102 return null;
103 }
104
105 internal override void GetTypesImpl(List<Type> list)
106 {
107 }
108
109 protected override Exception ArgumentOutOfRangeException()
110 {
111 return new NotSupportedException();
112 }
113
114 }
115
116}
global::java.lang.invoke.LambdaForm.Name Name
virtual Exception NotSupportedException()
override Exception ArgumentOutOfRangeException()