IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
ReflectionFieldSymbol.cs
Go to the documentation of this file.
1using System;
2using System.Reflection;
3
5{
6
8 {
9
10 readonly FieldInfo _underlyingField;
11
19 base(context, type.ContainingModule, type, underlyingField)
20 {
21 _underlyingField = underlyingField ?? throw new ArgumentNullException(nameof(underlyingField));
22 }
23
27 internal FieldInfo UnderlyingField => _underlyingField;
28
30 public FieldAttributes Attributes => _underlyingField.Attributes;
31
33 public ITypeSymbol FieldType => ResolveTypeSymbol(_underlyingField.FieldType);
34
36 public bool IsSpecialName => _underlyingField.IsSpecialName;
37
39 public bool IsAssembly => _underlyingField.IsAssembly;
40
42 public bool IsFamily => _underlyingField.IsFamily;
43
45 public bool IsFamilyAndAssembly => _underlyingField.IsFamilyAndAssembly;
46
48 public bool IsFamilyOrAssembly => _underlyingField.IsFamilyOrAssembly;
49
51 public bool IsInitOnly => _underlyingField.IsInitOnly;
52
54 public bool IsLiteral => _underlyingField.IsLiteral;
55
56#pragma warning disable SYSLIB0050 // Type or member is obsolete
58 public bool IsNotSerialized => _underlyingField.IsNotSerialized;
59#pragma warning restore SYSLIB0050 // Type or member is obsolete
60
62 public bool IsPinvokeImpl => _underlyingField.IsPinvokeImpl;
63
65 public bool IsPrivate => _underlyingField.IsPrivate;
66
68 public bool IsPublic => _underlyingField.IsPublic;
69
71 public bool IsStatic => _underlyingField.IsStatic;
72
75 {
76 return ResolveTypeSymbols(_underlyingField.GetOptionalCustomModifiers());
77 }
78
81 {
82 return ResolveTypeSymbols(_underlyingField.GetRequiredCustomModifiers());
83 }
84
86 public object? GetRawConstantValue()
87 {
88 return _underlyingField.GetRawConstantValue();
89 }
90
91 }
92
93}
IKVM.Reflection.FieldInfo FieldInfo
bool IsSpecialName
Gets a value indicating whether the corresponding SpecialName attribute is set in the FieldAttributes...
bool IsAssembly
Gets a value indicating whether the potential visibility of this field is described by FieldAttribute...
ITypeSymbol FieldType
Gets the type of this field object.
ITypeSymbol[] GetRequiredCustomModifiers()
Gets an array of types that identify the required custom modifiers of the property.
bool IsFamilyOrAssembly
Gets a value indicating whether the potential visibility of this field is described by FieldAttribute...
bool IsStatic
Gets a value indicating whether the field is static.
bool IsPinvokeImpl
Gets a value indicating whether the corresponding PinvokeImpl attribute is set in FieldAttributes.
ReflectionFieldSymbol(ReflectionSymbolContext context, ReflectionTypeSymbol type, FieldInfo underlyingField)
Initializes a new instance.
bool IsLiteral
Gets a value indicating whether the value is written at compile time and cannot be changed.
bool IsFamilyAndAssembly
Gets a value indicating whether the visibility of this field is described by FieldAttributes....
bool IsFamily
Gets a value indicating whether the visibility of this field is described by FieldAttributes....
object? GetRawConstantValue()
Returns a literal value associated with the field by a compiler.
FieldAttributes Attributes
Gets the attributes associated with this field.
bool IsInitOnly
Gets a value indicating whether the field can only be set in the body of the constructor.
ITypeSymbol[] GetOptionalCustomModifiers()
Gets an array of types that identify the optional custom modifiers of the field.
bool IsPrivate
Gets a value indicating whether the field is private.
bool IsPublic
Gets a value indicating whether the field is public.
Obtains information about the attributes of a member and provides access to member metadata.
Holds references to symbols derived from System.Reflection.
Discovers the attributes of a field and provides access to field metadata.
Represents type declarations: class types, interface types, array types, value types,...