IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
PropertyInfoWithReflectedType.cs
Go to the documentation of this file.
1/*
2 Copyright (C) 2009-2012 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*/
24namespace IKVM.Reflection
25{
26
27 sealed class PropertyInfoWithReflectedType : PropertyInfo
28 {
29
30 readonly Type reflectedType;
31 readonly PropertyInfo property;
32
38 internal PropertyInfoWithReflectedType(Type reflectedType, PropertyInfo property)
39 {
40 this.reflectedType = reflectedType;
41 this.property = property;
42 }
43
44 public override PropertyAttributes Attributes
45 {
46 get { return property.Attributes; }
47 }
48
49 public override bool CanRead
50 {
51 get { return property.CanRead; }
52 }
53
54 public override bool CanWrite
55 {
56 get { return property.CanWrite; }
57 }
58
59 public override MethodInfo GetGetMethod(bool nonPublic)
60 {
61 return SetReflectedType(property.GetGetMethod(nonPublic), reflectedType);
62 }
63
64 public override MethodInfo GetSetMethod(bool nonPublic)
65 {
66 return SetReflectedType(property.GetSetMethod(nonPublic), reflectedType);
67 }
68
69 public override MethodInfo[] GetAccessors(bool nonPublic)
70 {
71 return SetReflectedType(property.GetAccessors(nonPublic), reflectedType);
72 }
73
74 public override object GetRawConstantValue()
75 {
76 return property.GetRawConstantValue();
77 }
78
79 internal override bool IsPublic
80 {
81 get { return property.IsPublic; }
82 }
83
84 internal override bool IsNonPrivate
85 {
86 get { return property.IsNonPrivate; }
87 }
88
89 internal override bool IsStatic
90 {
91 get { return property.IsStatic; }
92 }
93
94 internal override PropertySignature PropertySignature
95 {
96 get { return property.PropertySignature; }
97 }
98
99 public override ParameterInfo[] GetIndexParameters()
100 {
101 var parameters = property.GetIndexParameters();
102 for (int i = 0; i < parameters.Length; i++)
103 parameters[i] = new ParameterInfoWrapper(this, parameters[i]);
104
105 return parameters;
106 }
107
108 internal override PropertyInfo BindTypeParameters(Type type)
109 {
110 return property.BindTypeParameters(type);
111 }
112
113 public override string ToString()
114 {
115 return property.ToString();
116 }
117
118 public override bool __IsMissing
119 {
120 get { return property.__IsMissing; }
121 }
122
123 public override Type DeclaringType
124 {
125 get { return property.DeclaringType; }
126 }
127
128 public override Type ReflectedType
129 {
130 get { return reflectedType; }
131 }
132
133 public override bool Equals(object obj)
134 {
135 var other = obj as PropertyInfoWithReflectedType;
136 return other != null
137 && other.reflectedType == reflectedType
138 && other.property == property;
139 }
140
141 public override int GetHashCode()
142 {
143 return reflectedType.GetHashCode() ^ property.GetHashCode();
144 }
145
146 public override int MetadataToken
147 {
148 get { return property.MetadataToken; }
149 }
150
151 public override Module Module
152 {
153 get { return property.Module; }
154 }
155
156 public override string Name
157 {
158 get { return property.Name; }
159 }
160
161 internal override bool IsBaked
162 {
163 get { return property.IsBaked; }
164 }
165
166 internal override int GetCurrentToken()
167 {
168 return property.GetCurrentToken();
169 }
170
171 }
172
173}
global::java.lang.invoke.LambdaForm.Name Name