IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
ReflectionPropertySymbol.cs
Go to the documentation of this file.
1using System;
2using System.Reflection;
3
5{
6
8 {
9
10 readonly PropertyInfo _underlyingProperty;
11
19 base(context, type.ContainingModule, type, underlyingProperty)
20 {
21 _underlyingProperty = underlyingProperty ?? throw new ArgumentNullException(nameof(underlyingProperty));
22 }
23
27 internal PropertyInfo UnderlyingProperty => _underlyingProperty;
28
30 public PropertyAttributes Attributes => _underlyingProperty.Attributes;
31
33 public bool CanRead => _underlyingProperty.CanRead;
34
36 public bool CanWrite => _underlyingProperty.CanWrite;
37
39 public bool IsSpecialName => _underlyingProperty.IsSpecialName;
40
42 public ITypeSymbol PropertyType => ResolveTypeSymbol(_underlyingProperty.PropertyType);
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 ResolveMethodSymbols(_underlyingProperty.GetAccessors());
60 }
61
63 public IMethodSymbol[] GetAccessors(bool nonPublic)
64 {
65 return ResolveMethodSymbols(_underlyingProperty.GetAccessors(nonPublic));
66 }
67
70 {
71 return ResolveParameterSymbols(_underlyingProperty.GetIndexParameters());
72 }
73
76 {
77 return _underlyingProperty.GetGetMethod() is MethodInfo m ? ResolveMethodSymbol(m) : null;
78 }
79
81 public IMethodSymbol? GetGetMethod(bool nonPublic)
82 {
83 return _underlyingProperty.GetGetMethod(nonPublic) is MethodInfo m ? ResolveMethodSymbol(m) : null;
84 }
85
88 {
89 return _underlyingProperty.GetSetMethod() is MethodInfo m ? ResolveMethodSymbol(m) : null;
90 }
91
93 public IMethodSymbol? GetSetMethod(bool nonPublic)
94 {
95 return _underlyingProperty.GetSetMethod(nonPublic) is MethodInfo m ? ResolveMethodSymbol(m) : null;
96 }
97
100 {
101 throw new NotImplementedException();
102 }
103
106 {
107 return ResolveTypeSymbols(_underlyingProperty.GetOptionalCustomModifiers());
108 }
109
112 {
113 return ResolveTypeSymbols(_underlyingProperty.GetRequiredCustomModifiers());
114 }
115 }
116
117}
IKVM.Reflection.PropertyInfo PropertyInfo
IKVM.Reflection.MethodInfo MethodInfo
Obtains information about the attributes of a member and provides access to member metadata.
ITypeSymbol[] GetOptionalCustomModifiers()
Returns an array of types representing the optional custom modifiers of the property.
IMethodSymbol? GetGetMethod(bool nonPublic)
When overridden in a derived class, returns the public or non-public get accessor for this property.
PropertyAttributes Attributes
Gets the attributes for this property.
IMethodSymbol? GetSetMethod()
Returns the public set accessor for this property.
IMethodSymbol? GetSetMethod(bool nonPublic)
When overridden in a derived class, returns the set accessor for this property.
ITypeSymbol PropertyType
Gets the type of this property.
ITypeSymbol GetModifiedPropertyType()
Gets the modified type of this property object.
ReflectionPropertySymbol(ReflectionSymbolContext context, ReflectionTypeSymbol type, PropertyInfo underlyingProperty)
Initializes a new instance.
ITypeSymbol[] GetRequiredCustomModifiers()
Returns an array of types representing the required custom modifiers of the property.
bool CanRead
Gets a value indicating whether the property can be read.
object? GetRawConstantValue()
Returns a literal value associated with the property by a compiler.
bool CanWrite
Gets a value indicating whether the property can be written to.
IMethodSymbol[] GetAccessors()
Returns an array whose elements reflect the public get and set accessors of the property reflected by...
IMethodSymbol? GetMethod
Gets the get accessor for this property.
IMethodSymbol[] GetAccessors(bool nonPublic)
Returns an array whose elements reflect the public and, if specified, non-public get and set accessor...
bool IsSpecialName
Gets a value indicating whether the property is the special name.
IMethodSymbol? GetGetMethod()
Returns the public get accessor for this property.
IMethodSymbol? SetMethod
Gets the set accessor for this property.
IParameterSymbol[] GetIndexParameters()
When overridden in a derived class, returns an array of all the index parameters for the property.
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,...