IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IkvmReflectionPropertySymbol.cs
Go to the documentation of this file.
1using System;
2
4
5using PropertyInfo = IKVM.Reflection.PropertyInfo;
6
8{
9
11 {
12
13 readonly PropertyInfo _underlyingProperty;
14
21 public IkvmReflectionPropertySymbol(IkvmReflectionSymbolContext context, IkvmReflectionTypeSymbol type, PropertyInfo underlyingProperty) :
22 base(context, type.ContainingModule, type, underlyingProperty)
23 {
24 _underlyingProperty = underlyingProperty ?? throw new ArgumentNullException(nameof(underlyingProperty));
25 }
26
27 public PropertyInfo UnderlyingProperty => _underlyingProperty;
28
30 public global::System.Reflection.PropertyAttributes Attributes => (global::System.Reflection.PropertyAttributes)_underlyingProperty.Attributes;
31
33 public ITypeSymbol PropertyType => ResolveTypeSymbol(_underlyingProperty.PropertyType);
34
36 public bool CanRead => _underlyingProperty.CanRead;
37
39 public bool CanWrite => _underlyingProperty.CanWrite;
40
42 public bool IsSpecialName => _underlyingProperty.IsSpecialName;
43
45 public IMethodSymbol? GetMethod => _underlyingProperty.GetMethod is { } m ? ResolveMethodSymbol(m) : null;
46
48 public IMethodSymbol? SetMethod => _underlyingProperty.SetMethod is { } m ? ResolveMethodSymbol(m) : null;
49
51 public object? GetRawConstantValue()
52 {
53 return _underlyingProperty.GetRawConstantValue();
54 }
55
58 {
59 return ResolveParameterSymbols(_underlyingProperty.GetIndexParameters());
60 }
61
64 {
65 throw new NotImplementedException();
66 }
67
70 {
71 return ResolveMethodSymbols(_underlyingProperty.GetAccessors());
72 }
73
75 public IMethodSymbol[] GetAccessors(bool nonPublic)
76 {
77 throw new NotImplementedException();
78 }
79
82 {
83 return _underlyingProperty.GetGetMethod() is MethodInfo m ? ResolveMethodSymbol(m) : null;
84 }
85
87 public IMethodSymbol? GetGetMethod(bool nonPublic)
88 {
89 return _underlyingProperty.GetGetMethod(nonPublic) is MethodInfo m ? ResolveMethodSymbol(m) : null;
90 }
91
94 {
95 return _underlyingProperty.GetSetMethod() is MethodInfo m ? ResolveMethodSymbol(m) : null;
96 }
97
99 public IMethodSymbol? GetSetMethod(bool nonPublic)
100 {
101 return _underlyingProperty.GetSetMethod(nonPublic) is MethodInfo m ? ResolveMethodSymbol(m) : null;
102 }
103
106 {
107 return ResolveTypeSymbols(_underlyingProperty.GetOptionalCustomModifiers());
108 }
109
112 {
113 return ResolveTypeSymbols(_underlyingProperty.GetRequiredCustomModifiers());
114 }
115
116 }
117
118}
object? GetRawConstantValue()
Returns a literal value associated with the property by a compiler.
global::System.Reflection.PropertyAttributes Attributes
Gets the attributes for this property.
IMethodSymbol? GetSetMethod()
Returns the public set accessor for this property.
IMethodSymbol? GetMethod
Gets the get accessor for this property.
IMethodSymbol[] GetAccessors()
Returns an array whose elements reflect the public get and set accessors of the property reflected by...
IkvmReflectionPropertySymbol(IkvmReflectionSymbolContext context, IkvmReflectionTypeSymbol type, PropertyInfo underlyingProperty)
Initializes a new instance.
bool IsSpecialName
Gets a value indicating whether the property is the special name.
bool CanRead
Gets a value indicating whether the property can be read.
IParameterSymbol[] GetIndexParameters()
When overridden in a derived class, returns an array of all the index parameters for the property.
IMethodSymbol? GetSetMethod(bool nonPublic)
When overridden in a derived class, returns the set accessor for this property.
IMethodSymbol? SetMethod
Gets the set accessor for this property.
ITypeSymbol[] GetOptionalCustomModifiers()
Returns an array of types representing the optional custom modifiers of the property.
ITypeSymbol[] GetRequiredCustomModifiers()
Returns an array of types representing the required custom modifiers of the property.
ITypeSymbol GetModifiedPropertyType()
Gets the modified type of this property object.
IMethodSymbol[] GetAccessors(bool nonPublic)
Returns an array whose elements reflect the public and, if specified, non-public get and set accessor...
IMethodSymbol? GetGetMethod()
Returns the public get accessor for this property.
IMethodSymbol? GetGetMethod(bool nonPublic)
When overridden in a derived class, returns the public or non-public get accessor for this property.
bool CanWrite
Gets a value indicating whether the property can be written to.
Holds references to symbols derived from System.Reflection.
Discovers the attributes of a method and provides access to method metadata.
Discovers the attributes of a parameter and provides access to parameter metadata.
Discovers the attributes of a property and provides access to property metadata.
Represents type declarations: class types, interface types, array types, value types,...